diff options
author | Mikhail Svetkin <mikhail.svetkin@gmail.com> | 2020-02-17 22:16:55 +0100 |
---|---|---|
committer | Mikhail Svetkin <mikhail.svetkin@gmail.com> | 2020-02-26 12:53:15 +0100 |
commit | a65cc1fa6e8b234ad57838a573ef17f29859bf6d (patch) | |
tree | 267cd4f0c599df189ebb7cda5a6c346423b9456e /src | |
parent | 65ba5db9e0f33d046b189e9a4847bea2d87a1b3c (diff) |
Do not disconnect on HTTP CONNECT method
According HTTP/1.1 specifications (RFC 7231) CONNECT is intended only
for use in requests to a proxy. That it is why http-parser sets the upgrade flag.
This patch will allow users to decide how to handle this.
Change-Id: Ic2d10ca4ab113b4cac85e14f15af7890d5773e98
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/httpserver/qhttpserverrequest.cpp | 2 | ||||
-rw-r--r-- | src/httpserver/qhttpserverrequest.h | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/httpserver/qhttpserverrequest.cpp b/src/httpserver/qhttpserverrequest.cpp index 20c2821..5c0ac5f 100644 --- a/src/httpserver/qhttpserverrequest.cpp +++ b/src/httpserver/qhttpserverrequest.cpp @@ -291,6 +291,8 @@ QHttpServerRequest::Method QHttpServerRequest::method() const return QHttpServerRequest::Method::Options; case HTTP_PATCH: return QHttpServerRequest::Method::Patch; + case HTTP_CONNECT: + return QHttpServerRequest::Method::Connect; default: return QHttpServerRequest::Method::Unknown; } diff --git a/src/httpserver/qhttpserverrequest.h b/src/httpserver/qhttpserverrequest.h index ea4fc7f..4ace46a 100644 --- a/src/httpserver/qhttpserverrequest.h +++ b/src/httpserver/qhttpserverrequest.h @@ -65,8 +65,9 @@ public: Head = 0x0010, Options = 0x0020, Patch = 0x0040, + Connect = 0x0080, - All = Get | Put | Delete | Post | Head | Options | Patch, + All = Get | Put | Delete | Post | Head | Options | Patch | Connect, // Include upper-case aliases for the sake of parsing from strings: GET = Get, @@ -75,7 +76,8 @@ public: POST = Post, HEAD = Head, OPTIONS = Options, - PATCH = Patch + PATCH = Patch, + CONNECT = Connect }; Q_ENUM(Method) Q_DECLARE_FLAGS(Methods, Method) |