Skip to content

Commit 30c6abb

Browse files
committed
add GET method for CORS
1 parent 29f6d82 commit 30c6abb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/server/server.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2396,7 +2396,7 @@ int main(int argc, char ** argv) {
23962396
// If this is OPTIONS request, skip validation because browsers don't include Authorization header
23972397
if (req.method == "OPTIONS") {
23982398
res.set_header("Access-Control-Allow-Credentials", "true");
2399-
res.set_header("Access-Control-Allow-Methods", "POST");
2399+
res.set_header("Access-Control-Allow-Methods", "GET, POST");
24002400
res.set_header("Access-Control-Allow-Headers", "*");
24012401
res.set_content("", "text/html"); // blank response, no data
24022402
return httplib::Server::HandlerResponse::Handled; // skip further processing

0 commit comments

Comments
 (0)