Add CORS header to file jobs
This commit is contained in:
parent
65cb1488b0
commit
7cce3987eb
2 changed files with 12 additions and 0 deletions
|
@ -34,4 +34,13 @@ void URLRequestAsyncAsarJob::StartAsync(scoped_ptr<base::Value> options) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void URLRequestAsyncAsarJob::GetResponseInfo(net::HttpResponseInfo* info) {
|
||||
std::string status("HTTP/1.1 200 OK");
|
||||
net::HttpResponseHeaders* headers = new net::HttpResponseHeaders(status);
|
||||
|
||||
headers->AddHeader(kCorsHeader);
|
||||
info->headers = headers;
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
|
|
|
@ -18,6 +18,9 @@ class URLRequestAsyncAsarJob : public JsAsker<asar::URLRequestAsarJob> {
|
|||
// JsAsker:
|
||||
void StartAsync(scoped_ptr<base::Value> options) override;
|
||||
|
||||
// URLRequestJob:
|
||||
void GetResponseInfo(net::HttpResponseInfo* info) override;
|
||||
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(URLRequestAsyncAsarJob);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue