provide option to override status line

This commit is contained in:
deepak1556 2016-04-08 14:03:57 +05:30
parent 4fc35a4587
commit 3fb39ad3ef
3 changed files with 33 additions and 4 deletions

View file

@ -322,6 +322,25 @@ describe('webRequest module', function () {
}
})
})
it('can change the header status', function (done) {
ses.webRequest.onHeadersReceived(function (details, callback) {
var responseHeaders = details.responseHeaders
callback({
responseHeaders: responseHeaders,
statusLine: "HTTP/1.1 404 Not Found"
})
})
$.ajax({
url: defaultURL,
success: function (data, status, xhr) {
},
error: function (xhr, errorType) {
assert.equal(xhr.getResponseHeader('Custom'), 'Header')
done()
}
})
})
})
describe('webRequest.onResponseStarted', function () {