Cache CORS preflight request
This commit is contained in:
parent
c2892d7887
commit
55b26751ae
@ -224,7 +224,10 @@ void initServer()
|
|||||||
//make API CORS compatible
|
//make API CORS compatible
|
||||||
if (request->method() == HTTP_OPTIONS)
|
if (request->method() == HTTP_OPTIONS)
|
||||||
{
|
{
|
||||||
request->send(200); return;
|
AsyncWebServerResponse *response = request->beginResponse(200);
|
||||||
|
response->addHeader(F("Access-Control-Max-Age"), F("7200"));
|
||||||
|
request->send(response);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(handleSet(request, request->url())) return;
|
if(handleSet(request, request->url())) return;
|
||||||
|
Loading…
Reference in New Issue
Block a user