mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-01-09 14:28:22 +00:00
disable cross-domain requests
This commit is contained in:
parent
fdb08e9ca0
commit
35bf35a50c
@ -385,19 +385,6 @@ bool ReadHTTPRequestLine(std::basic_istream<char>& stream, int &proto,
|
|||||||
|
|
||||||
// HTTP methods permitted: GET, POST
|
// HTTP methods permitted: GET, POST
|
||||||
http_method = vWords[0];
|
http_method = vWords[0];
|
||||||
if (http_method == "OPTIONS") {
|
|
||||||
string replyOptions= strprintf(
|
|
||||||
"HTTP/1.1 %d %s\r\n"
|
|
||||||
"Date: %s\r\n"
|
|
||||||
"Connection: close\r\n"
|
|
||||||
"Allow: GET,POST,OPTIONS\r\n"
|
|
||||||
"Access-Control-Allow-Origin: *\r\n"
|
|
||||||
"Access-Control-Allow-Methods: POST, GET, OPTIONS\r\n"
|
|
||||||
"Access-Control-Allow-Headers: origin, x-csrf-token, content-type, accept, authorization\r\n"
|
|
||||||
"Server: bitcoin-json-rpc/%s\r\n"
|
|
||||||
"\r\n", HTTP_OK, "OK", rfc1123Time().c_str(), FormatFullVersion().c_str());
|
|
||||||
(*static_cast<std::iostream*>(&stream)) << replyOptions << std::flush;
|
|
||||||
}
|
|
||||||
if (http_method != "GET" && http_method != "POST")
|
if (http_method != "GET" && http_method != "POST")
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user