[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
|
// For CORS headers
|
||||||
allow_origin = cfg_getstr(cfg_getsec(cfg, "general"), "allow_origin");
|
allow_origin = cfg_getstr(cfg_getsec(cfg, "general"), "allow_origin");
|
||||||
if (allow_origin && (strlen(allow_origin) == 0))
|
if (allow_origin)
|
||||||
allow_origin = NULL;
|
{
|
||||||
|
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)
|
if (v6enabled)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue