don't send content-type when options is set

1.2-legacy
Jm Casler 2020-10-16 17:46:22 -07:00
rodzic ba549d8fcd
commit 8f0105ccd9
1 zmienionych plików z 5 dodań i 1 usunięć

Wyświetl plik

@ -379,7 +379,11 @@ void handleAPIv1ToRadio(HTTPRequest *req, HTTPResponse *res)
*/
// Status code is 200 OK by default.
res->setHeader("Content-Type", "application/x-protobuf");
if (req->getMethod() != "OPTIONS") {
res->setHeader("Content-Type", "application/x-protobuf");
}
res->setHeader("Access-Control-Allow-Origin", "*");
res->setHeader("Access-Control-Allow-Methods", "PUT, OPTIONS");