Skip to content

Commit 50d219b

Browse files
committed
Add check for allowed header in setRequestHeader
1 parent b343e28 commit 50d219b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/XMLHttpRequest.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ exports.XMLHttpRequest = function() {
169169
if (this.readyState != this.OPENED) {
170170
throw "INVALID_STATE_ERR: setRequestHeader can only be called when state is OPEN";
171171
}
172+
if (!isAllowedHttpHeader(header)) {
173+
throw "SYNTAX_ERR: This header is not allowed";
174+
}
172175
if (sendFlag) {
173176
throw "INVALID_STATE_ERR: send flag is true";
174177
}

0 commit comments

Comments
 (0)