mirror of
https://github.com/rikkaneko/paste.git
synced 2025-06-06 08:35:44 +00:00
Add error message text response (frontend)
Use Referer header over Origin header Signed-off-by: Joe Ma <rikkaneko23@gmail.com>
This commit is contained in:
parent
a88c7321cf
commit
8704a9161e
2 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue