* Fix HttpServer::isWebSocket to detect lowercase "upgrade" connection value
The websocket library boost-beast sends the following http header:
'Connection: upgrade', while almost anything else uses:
'Connection: Upgrade'. Drogon used to only recognize the latter as
websocket request, now it recognizes both.
* Fix HttpServer::isWebSocket to detect case-insenstive "websocket"
upgrade value
This was a bug as previously, we only accepted the exact string
"websocket", although the standard specifies that it should be
case-insensetive.
Co-authored-by: VayuDev <vayudev@protonmail.com>
Add default initializer for HttpConstraint::method_ member variable to avoid the following warning given by gcc's undefined behavior sanitizer (-fsanitize=undefined):
drogon/lib/inc/drogon/utils/HttpConstraint.h:30:7: runtime error: load of value 32767, which is not a valid value for type 'HttpMethod'
1.Except for the GET method, it is forbidden to use any other method for accessing static files.
2.Use following sequence to create 404 pages.
* try to use user customized 404 handler;
* try to use user customized error handler;
* use default handler to create 404 pages;
* Fix CORS for new HTTP PATCH method, also fix HttpRequestImpl::appendToBuffer, to be able to send PATCH requests
* Fix simple_example_test to work with updated CORS
* add digest filter in examples
* Add getMd5() function to the public API
Co-authored-by: Adrián Ortiz Gutiérrez <aortiz@MacBook-Pro.local>
Co-authored-by: antao <antao2002@gmail.com>
This patch adds support for the RFC 850 and asctime format. If an error
occurs, we now return a date with the epoch value of -1 and warn instead of
triggering undefined behavior. This is checked by a new set of tests.
Co-authored-by: VayuDev <vayudev@protonmail.com>
Co-authored-by: antao <antao2002@gmail.com>
* Add getContextRef method to the WebSocketConnection class
* Expose some functions on Windows
* Send a close message when closing a web socket connection