mirror of
https://github.com/owntone/owntone-server.git
synced 2025-02-04 10:26:02 -05:00
[httpd] Allow cross origin POST, PUT, DELETE, OPTIONS requests
If the web interface is hosted on a different server, this is required to allow sending e. g. post/put requests to control outputs.
This commit is contained in:
parent
a764fb3c52
commit
d59e62312a
@ -743,9 +743,7 @@ httpd_gen_cb(struct evhttp_request *req, void *arg)
|
||||
output_headers = evhttp_request_get_output_headers(req);
|
||||
|
||||
evhttp_add_header(output_headers, "Access-Control-Allow-Origin", allow_origin);
|
||||
|
||||
// Allow only GET method and authorization header in cross origin requests
|
||||
evhttp_add_header(output_headers, "Access-Control-Allow-Method", "GET");
|
||||
evhttp_add_header(output_headers, "Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS");
|
||||
evhttp_add_header(output_headers, "Access-Control-Allow-Headers", "authorization");
|
||||
|
||||
// In this case there is no reason to go through httpd_send_reply
|
||||
|
Loading…
x
Reference in New Issue
Block a user