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:
Joe Ma 2024-02-05 12:33:09 +08:00
parent a88c7321cf
commit 8704a9161e
No known key found for this signature in database
GPG key ID: 7A0ECF5F5EDC587F
2 changed files with 2 additions and 2 deletions

View file

@ -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);