We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d99a386 commit 67200ddCopy full SHA for 67200dd
index.js
@@ -198,6 +198,10 @@ function run_xhr(options) {
198
xhr.open(options.method, options.uri, true) // asynchronous
199
if(is_cors)
200
xhr.withCredentials = !! options.withCredentials
201
+
202
+ for (var key in options.headers)
203
+ xhr.setRequestHeader(key, options.headers[key])
204
205
xhr.send(options.body)
206
return xhr
207
@@ -209,8 +213,6 @@ function run_xhr(options) {
209
213
210
214
if(xhr.readyState === XHR.OPENED) {
211
215
request.log.debug('Request started', {'id':xhr.id})
212
- for (var key in options.headers)
- xhr.setRequestHeader(key, options.headers[key])
216
}
217
218
else if(xhr.readyState === XHR.HEADERS_RECEIVED)
0 commit comments