CORS check removed

pull/17/head
moneroexamples 7 years ago
parent fc4aee86b0
commit 650277b0ad

@ -1,5 +1,4 @@
{
"frontend-url": "http://127.0.0.1",
"daemon-url" :
{
"mainnet" : "http:://127.0.0.1:18081",

@ -53,7 +53,7 @@ var thinwalletApp = angular.module('thinWallet', [
]);
thinwalletApp.config(['$httpProvider', function($httpProvider) {
$httpProvider.defaults.withCredentials = true;
$httpProvider.defaults.withCredentials = false;
delete $httpProvider.defaults.headers.common['X-Requested-With'];
}]);

@ -148,11 +148,6 @@ xmreg::CurrentBlockchainStatus::start_monitor_blockchain_thread();
// create REST JSON API services
// Open Monero frontend url. Frontend url must match this value in
// server. Otherwise CORS problems between frontend and backend can occure
xmreg::YourMoneroRequests::frontend_url
= config_json["frontend-url"];
xmreg::YourMoneroRequests open_monero(
shared_ptr<xmreg::MySqlAccounts>(new xmreg::MySqlAccounts{}));

@ -916,20 +916,12 @@ YourMoneroRequests::generic_options_handler( const shared_ptr< Session > session
}
multimap<string, string>
YourMoneroRequests::make_headers(const multimap<string, string>& extra_headers)
{
multimap<string, string> headers {
{"Date" , get_current_time()},
{"Access-Control-Allow-Origin" , frontend_url},
{"access-control-allow-headers" , "*, DNT,X-CustomHeader,Keep-Alive,User-Agent,"
"X-Requested-With,If-Modified-Since,Cache-Control,"
"Content-Type,Set-Cookie"},
{"access-control-max-age" , "86400, 1728000"},
{"access-control-allow-methods" , "GET, POST, OPTIONS"},
{"access-control-allow-credentials", "true"},
{"Access-Control-Allow-Origin" , "*"},
{"Access-Control-Allow-Headers" , "Content-Type"},
{"Content-Type" , "application/json"}
};
@ -938,7 +930,6 @@ YourMoneroRequests::make_headers(const multimap<string, string>& extra_headers)
return headers;
};
void
YourMoneroRequests::print_json_log(const string& text, const json& j)
{
@ -1017,12 +1008,6 @@ YourMoneroRequests::parse_request(
}
}
// define default static variables
string YourMoneroRequests::frontend_url {"http://127.0.0.1:81"};
}

@ -51,8 +51,6 @@ class YourMoneroRequests
public:
static string frontend_url;
YourMoneroRequests(shared_ptr<MySqlAccounts> _acc);
/**

Loading…
Cancel
Save