mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Add CORS header to file jobs
This commit is contained in:
@@ -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);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user