You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When receiving a request with the cpprestsdk http_listener, the Date header from the sent request is mapped to the Data header in the http_request of cpprestsdk.
According to line 47 in Release/src/http/listener/http_server_httpsys.cpp, the values of HttpServerAPIKnownHeaders are supposed to match the values of the _HTTP_HEADER_ID enum (defined here). HttpServerAPIKnownHeaders states Data as the third entry, whereas _HTTP_HEADER_ID lists Date.
If someone could please verify that the issue is indeed present and that the cuplrit is the suggested typo, I would gladly provide a pullrequest to be merged into this project.
The text was updated successfully, but these errors were encountered:
At the same time, it would be nice to fix "Content-Md5", "Etag" and "Www-Authenticate" to the canonical "Content-MD5", "ETag" and "WWW-Authenticate" slightly further down the same file, even though header names are compared case-insensitively.
And all these fixes should please also be applied to Release\tests\functional\http\utilities\test_http_server.cpp.
Actually, the HttpServerAPIKnownHeaders is more broken than it first appears, since the HTTP Server API HTTP_HEADER_ID is not a simple auto-numbered enum but rather includes common, and request- and response-specific headers in a single enum with constant initializers for the defined indices in the HTTP_REQUEST_HEADERS::KnownHeadersand the HTTP_RESPONSE_HEADERS::KnownHeaders arrays. For example, both HttpHeaderAcceptCharset (the request header, "Accept-Charset") and HttpHeaderAge (the response header, "Age") are given the same value, 21.
As it stands, HttpServerAPIKnownHeaders is only used to parse request headers, so rather than create a new structure that works for both, I propose to remove the response-specific headers and clarify its intended use. PR on its way...
When receiving a request with the cpprestsdk http_listener, the
Date
header from the sent request is mapped to theData
header in thehttp_request
of cpprestsdk.According to line
47
inRelease/src/http/listener/http_server_httpsys.cpp
, the values ofHttpServerAPIKnownHeaders
are supposed to match the values of the_HTTP_HEADER_ID
enum (defined here).HttpServerAPIKnownHeaders
statesData
as the third entry, whereas_HTTP_HEADER_ID
listsDate
.If someone could please verify that the issue is indeed present and that the cuplrit is the suggested typo, I would gladly provide a pullrequest to be merged into this project.
The text was updated successfully, but these errors were encountered: