mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-27 15:45:56 -05:00
[httpd] Enable OPTIONS for evhttp (if CORS headers are enabled)
This commit is contained in:
parent
54a09fce63
commit
2ce1c8d28f
@ -1442,8 +1442,13 @@ httpd_init(void)
|
||||
|
||||
// For CORS headers
|
||||
allow_origin = cfg_getstr(cfg_getsec(cfg, "general"), "allow_origin");
|
||||
if (allow_origin && (strlen(allow_origin) == 0))
|
||||
allow_origin = NULL;
|
||||
if (allow_origin)
|
||||
{
|
||||
if (strlen(allow_origin) != 0)
|
||||
evhttp_set_allowed_methods(evhttpd, EVHTTP_REQ_GET | EVHTTP_REQ_POST | EVHTTP_REQ_OPTIONS);
|
||||
else
|
||||
allow_origin = NULL;
|
||||
}
|
||||
|
||||
if (v6enabled)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user