Allow Zotero.Server requests with Host: localhost
Previously only Host: 127.0.0.1 was allowed. (The check prevents a DNS rebinding attack.) This allows requests to translation-server using localhost (zotero/translation-server#48). Fixes #125
This commit is contained in:
parent
df2216960b
commit
9372979fb5
1 changed files with 1 additions and 1 deletions
|
@ -237,7 +237,7 @@ Zotero.Server.DataListener.prototype._headerFinished = function() {
|
|||
Zotero.debug(this.header, 5);
|
||||
|
||||
const methodRe = /^([A-Z]+) ([^ \r\n?]+)(\?[^ \r\n]+)?/;
|
||||
const hostRe = /[\r\n]Host: *127\.0\.0\.1(:[0-9]+)?[\r\n]/i;
|
||||
const hostRe = /[\r\n]Host: *(localhost|127\.0\.0\.1)(:[0-9]+)?[\r\n]/i;
|
||||
const contentTypeRe = /[\r\n]Content-Type: *([^ \r\n]+)/i;
|
||||
|
||||
if(!Zotero.isServer) {
|
||||
|
|
Loading…
Reference in a new issue