namespace atom {
-const std::string kCorsHeader("Access-Control-Allow-Origin: *");
-
namespace internal {
namespace {
#ifndef ATOM_BROWSER_NET_JS_ASKER_H_
#define ATOM_BROWSER_NET_JS_ASKER_H_
-#include <string>
-
#include "base/callback.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "v8/include/v8.h"
namespace atom {
-extern const std::string kCorsHeader;
using JavaScriptHandler =
base::Callback<void(const net::URLRequest*, v8::Local<v8::Value>)>;
#include <string>
+#include "atom/common/atom_constants.h"
+
namespace atom {
URLRequestAsyncAsarJob::URLRequestAsyncAsarJob(
}
}
-
void URLRequestAsyncAsarJob::GetResponseInfo(net::HttpResponseInfo* info) {
std::string status("HTTP/1.1 200 OK");
net::HttpResponseHeaders* headers = new net::HttpResponseHeaders(status);
- headers->AddHeader(kCorsHeader);
+ headers->AddHeader(kCORSHeader);
info->headers = headers;
}
#include <string>
+#include "atom/common/atom_constants.h"
#include "base/strings/string_number_conversions.h"
#include "net/base/net_errors.h"
status.append("\0\0", 2);
net::HttpResponseHeaders* headers = new net::HttpResponseHeaders(status);
- headers->AddHeader(kCorsHeader);
+ headers->AddHeader(kCORSHeader);
if (!mime_type_.empty()) {
std::string content_type_header(net::HttpRequestHeaders::kContentType);
#include <string>
+#include "atom/common/atom_constants.h"
#include "net/base/net_errors.h"
namespace atom {
std::string status("HTTP/1.1 200 OK");
net::HttpResponseHeaders* headers = new net::HttpResponseHeaders(status);
- headers->AddHeader(kCorsHeader);
+ headers->AddHeader(kCORSHeader);
if (!mime_type_.empty()) {
std::string content_type_header(net::HttpRequestHeaders::kContentType);
--- /dev/null
+// Copyright (c) 2015 GitHub, Inc.
+// Use of this source code is governed by the MIT license that can be
+// found in the LICENSE file.
+
+#include "atom/common/atom_constants.h"
+
+namespace atom {
+
+const char* kCORSHeader = "Access-Control-Allow-Origin: *";
+
+} // namespace atom
--- /dev/null
+// Copyright (c) 2015 GitHub, Inc.
+// Use of this source code is governed by the MIT license that can be
+// found in the LICENSE file.
+
+#ifndef ATOM_COMMON_ATOM_CONSTANTS_H_
+#define ATOM_COMMON_ATOM_CONSTANTS_H_
+
+namespace atom {
+
+// Header to ignore CORS.
+extern const char* kCORSHeader;
+
+} // namespace atom
+
+#endif // ATOM_COMMON_ATOM_CONSTANTS_H_
'atom/common/asar/scoped_temporary_file.h',
'atom/common/atom_command_line.cc',
'atom/common/atom_command_line.h',
+ 'atom/common/atom_constants.cc',
+ 'atom/common/atom_constants.h',
'atom/common/common_message_generator.cc',
'atom/common/common_message_generator.h',
'atom/common/crash_reporter/crash_reporter.cc',