Add CORS header to file jobs

This commit is contained in:
Paul Betts 2015-11-25 15:00:47 -08:00
parent 65cb1488b0
commit 7cce3987eb
2 changed files with 12 additions and 0 deletions

View file

@ -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

View file

@ -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);
};