diff --git a/frontend/static/paste.js b/frontend/static/paste.js index 1534f3e..bedb99c 100644 --- a/frontend/static/paste.js +++ b/frontend/static/paste.js @@ -335,7 +335,7 @@ $(function () { show_pop_alert(`Paste #${paste_info.uuid} created!`, 'alert-success'); pass_input.val(''); } else { - throw new Error('Unable to upload paste'); + throw new Error(`Unable to upload paste: ${(await res.text()) || `${res.status} ${res.statusText}`}`); } } catch (err) { console.log('error', err); diff --git a/src/index.ts b/src/index.ts index b8aeb39..2ea23cd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -36,7 +36,7 @@ router.all('*', (request) => { agent.includes(v) ); // Append the origin/referer - request.origin = headers.get('origin') ?? undefined; + request.origin = headers.get('referer') ?? undefined; }); // Handle preflighted CORS request