Skip to content

Commit 5e3fb60

Browse files
committed
Merge pull request #778 from CanTireInnovations/httpOptions
Adding support for OPTIONS requests to ESP8266WebServer
2 parents 82bb82a + eb8c1fa commit 5e3fb60

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

libraries/ESP8266WebServer/src/ESP8266WebServer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
#include <functional>
2828

29-
enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE };
29+
enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS };
3030
enum HTTPUploadStatus { UPLOAD_FILE_START, UPLOAD_FILE_WRITE, UPLOAD_FILE_END };
3131

3232
#define HTTP_DOWNLOAD_UNIT_SIZE 1460

libraries/ESP8266WebServer/src/Parsing.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ bool ESP8266WebServer::_parseRequest(WiFiClient& client) {
5959
method = HTTP_POST;
6060
} else if (methodStr == "DELETE") {
6161
method = HTTP_DELETE;
62+
} else if (methodStr == "OPTIONS") {
63+
method = HTTP_OPTIONS;
6264
} else if (methodStr == "PUT") {
6365
method = HTTP_PUT;
6466
} else if (methodStr == "PATCH") {

0 commit comments

Comments
 (0)