add GET method for CORS
This commit is contained in:
parent
29f6d82b19
commit
30c6abb73f
1 changed files with 1 additions and 1 deletions
|
@ -2396,7 +2396,7 @@ int main(int argc, char ** argv) {
|
||||||
// If this is OPTIONS request, skip validation because browsers don't include Authorization header
|
// If this is OPTIONS request, skip validation because browsers don't include Authorization header
|
||||||
if (req.method == "OPTIONS") {
|
if (req.method == "OPTIONS") {
|
||||||
res.set_header("Access-Control-Allow-Credentials", "true");
|
res.set_header("Access-Control-Allow-Credentials", "true");
|
||||||
res.set_header("Access-Control-Allow-Methods", "POST");
|
res.set_header("Access-Control-Allow-Methods", "GET, POST");
|
||||||
res.set_header("Access-Control-Allow-Headers", "*");
|
res.set_header("Access-Control-Allow-Headers", "*");
|
||||||
res.set_content("", "text/html"); // blank response, no data
|
res.set_content("", "text/html"); // blank response, no data
|
||||||
return httplib::Server::HandlerResponse::Handled; // skip further processing
|
return httplib::Server::HandlerResponse::Handled; // skip further processing
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue