summaryrefslogtreecommitdiff
path: root/src/HttpServerCommand.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2011-08-18 21:22:48 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2011-08-18 21:24:18 +0900
commit384ef111b90b7bcb04b8ff477eca7218a99cb98d (patch)
treeab6627f0f2f15d98f78f3ad0e83c703fad871161 /src/HttpServerCommand.cc
parent4c1c38a33f669ce09fe9b6cd046b270cf70253ac (diff)
Added --rpc-allow-origin-all option.
This option adds Access-Control-Allow-Origin header field with value '*' to the RPC response.
Diffstat (limited to 'src/HttpServerCommand.cc')
-rw-r--r--src/HttpServerCommand.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/HttpServerCommand.cc b/src/HttpServerCommand.cc
index 8306ad15..4dd43a7c 100644
--- a/src/HttpServerCommand.cc
+++ b/src/HttpServerCommand.cc
@@ -66,6 +66,9 @@ HttpServerCommand::HttpServerCommand
e_->addSocketForReadCheck(socket_, this);
httpServer_->setUsernamePassword(e_->getOption()->get(PREF_RPC_USER),
e_->getOption()->get(PREF_RPC_PASSWD));
+ if(e_->getOption()->getAsBool(PREF_RPC_ALLOW_ORIGIN_ALL)) {
+ httpServer_->setAllowOrigin("*");
+ }
#ifdef HAVE_ZLIB
httpServer_->enableGZip();
#else // !HAVE_ZLIB