aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-12-02 09:22:17 +0200
committerRiccardo Spagni <ric@spagni.net>2017-12-02 09:22:17 +0200
commit0d7162dc10009c21d4a8604265a67fe5750dc7aa (patch)
treed0e8965d18fbd4bea008070605cb19d1a959debc
parentMerge pull request #2828 (diff)
parentRPC: CORS add Access-Control-Allow-Headers to OPTIONS preflight (diff)
downloadmonero-0d7162dc10009c21d4a8604265a67fe5750dc7aa.tar.xz
Merge pull request #2830
f5461a6a RPC: CORS add Access-Control-Allow-Headers to OPTIONS preflight (Tim L)
-rw-r--r--contrib/epee/include/net/http_protocol_handler.inl3
1 files changed, 3 insertions, 0 deletions
diff --git a/contrib/epee/include/net/http_protocol_handler.inl b/contrib/epee/include/net/http_protocol_handler.inl
index c3350bf73..c555707ac 100644
--- a/contrib/epee/include/net/http_protocol_handler.inl
+++ b/contrib/epee/include/net/http_protocol_handler.inl
@@ -639,6 +639,9 @@ namespace net_utils
buf += "Access-Control-Allow-Origin: ";
buf += m_query_info.m_header_info.m_origin;
buf += "\r\n";
+ buf += "Access-Control-Expose-Headers: www-authenticate\r\n";
+ if (m_query_info.m_http_method == http::http_method_options)
+ buf += "Access-Control-Allow-Headers: Content-Type, Authorization, X-Requested-With\r\n";
buf += "Access-Control-Allow-Methods: POST, PUT, GET, OPTIONS\r\n";
}
}