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/HttpServerCommand.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/HttpServerCommand.cc') 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 -- cgit