]> khamidou — GitHub mirrors - electron.git/commitdiff
Add CORS header to file jobs
authorPaul Betts <paul@paulbetts.org>
Wed, 25 Nov 2015 23:00:47 +0000 (15:00 -0800)
committerPaul Betts <paul@paulbetts.org>
Mon, 30 Nov 2015 19:08:45 +0000 (11:08 -0800)
atom/browser/net/url_request_async_asar_job.cc
atom/browser/net/url_request_async_asar_job.h

index 303bfc0170d91b358011ca4e6db332d54802d0e1..86d92071e32026a695af2239713810d671a9db46 100644 (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
index df1aed350b8b81f609be287cac09651f6a705986..d65142f0bdbbd690ce52619e15e1a6cac903c2bb 100644 (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);
 };