Skip to content

Commit

Permalink
Merge pull request monero-project#2830
Browse files Browse the repository at this point in the history
f5461a6 RPC: CORS add Access-Control-Allow-Headers to OPTIONS preflight (Tim L)
  • Loading branch information
fluffypony committed Dec 2, 2017
2 parents 0bf4d6d + f5461a6 commit 0d7162d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions contrib/epee/include/net/http_protocol_handler.inl
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
}
Expand Down

0 comments on commit 0d7162d

Please sign in to comment.