From 384ef111b90b7bcb04b8ff477eca7218a99cb98d Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 18 Aug 2011 21:22:48 +0900 Subject: Added --rpc-allow-origin-all option. This option adds Access-Control-Allow-Origin header field with value '*' to the RPC response. --- src/HttpServer.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/HttpServer.cc') diff --git a/src/HttpServer.cc b/src/HttpServer.cc index 31893c95..9d3eaaa7 100644 --- a/src/HttpServer.cc +++ b/src/HttpServer.cc @@ -165,6 +165,9 @@ void HttpServer::feedResponse(const std::string& status, strappend(header, "Content-Length: ", util::uitos(text.size()), "\r\n", "Expires: ", httpDate, "\r\n", "Cache-Control: no-cache\r\n"); + if(!allowOrigin_.empty()) { + strappend(header, "Access-Control-Allow-Origin: ", allowOrigin_, "\r\n"); + } if(supportsGZip()) { header += "Content-Encoding: gzip\r\n"; } -- cgit