Fix server error if User-Agent isn't set
https://forums.zotero.org/discussion/78502/http-user-agents-that-dont-identify-fail-for-zotero-v5-0-71
This commit is contained in:
parent
66f2d177a9
commit
3af8f56c35
1 changed files with 1 additions and 1 deletions
|
@ -431,7 +431,7 @@ Zotero.Server.DataListener.prototype._processEndpoint = Zotero.Promise.coroutine
|
|||
'multipart/form-data',
|
||||
'text/plain'
|
||||
];
|
||||
var isBrowser = this.headers['user-agent'].startsWith('Mozilla/')
|
||||
var isBrowser = (this.headers['user-agent'] && this.headers['user-agent'].startsWith('Mozilla/'))
|
||||
// Origin isn't sent via fetch() for HEAD/GET, but for crazy UA strings, protecting
|
||||
// POST requests is better than nothing
|
||||
|| 'origin' in this.headers;
|
||||
|
|
Loading…
Add table
Reference in a new issue