Merge pull request #2347 from deepak1556/fetch_job_headers_patch

protocol: fix request headers in urlRequestFetchJob
This commit is contained in:
Cheng Zhao 2015-07-29 11:44:47 +08:00
commit 9afb973498
2 changed files with 2 additions and 4 deletions

View file

@ -107,10 +107,7 @@ URLRequestFetchJob::URLRequestFetchJob(
} }
// Use |request|'s headers. // Use |request|'s headers.
net::HttpRequestHeaders headers; fetcher_->SetExtraRequestHeaders(request->extra_request_headers().ToString());
if (request->GetFullRequestHeaders(&headers)) {
fetcher_->SetExtraRequestHeaders(headers.ToString());
}
} }
net::URLRequestContextGetter* URLRequestFetchJob::GetRequestContext() { net::URLRequestContextGetter* URLRequestFetchJob::GetRequestContext() {

View file

@ -81,6 +81,7 @@ describe 'protocol module', ->
it 'returns RequestHttpJob should send respone', (done) -> it 'returns RequestHttpJob should send respone', (done) ->
server = http.createServer (req, res) -> server = http.createServer (req, res) ->
assert.notEqual req.headers.accept, ''
res.writeHead(200, {'Content-Type': 'text/plain'}) res.writeHead(200, {'Content-Type': 'text/plain'})
res.end('hello') res.end('hello')
server.close() server.close()