Allow CORS requests in osrm-routed.
This commit is contained in:
parent
b0f9a0feb4
commit
9b1f108051
@ -127,6 +127,11 @@ void RequestHandler::handle_request(const http::request ¤t_request,
|
|||||||
osrm::json::render(current_reply.content, json_result);
|
osrm::json::render(current_reply.content, json_result);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
current_reply.headers.emplace_back("Access-Control-Allow-Origin", "*");
|
||||||
|
current_reply.headers.emplace_back("Access-Control-Allow-Methods", "GET");
|
||||||
|
current_reply.headers.emplace_back("Access-Control-Allow-Headers", "X-Requested-With");
|
||||||
|
|
||||||
// set headers
|
// set headers
|
||||||
current_reply.headers.emplace_back("Content-Length",
|
current_reply.headers.emplace_back("Content-Length",
|
||||||
cast::integral_to_string(current_reply.content.size()));
|
cast::integral_to_string(current_reply.content.size()));
|
||||||
|
Loading…
Reference in New Issue
Block a user