* 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
* Use uuid(3) to generate UUIDs on FreeBSD
FreeBSD is now handled like Windows so additional UUID libraries are
not required.
* Modify build.sh script to work on FreeBSD
- /bin/bash -> /usr/bin/env bash
- nproc -> sysctl -n hw.ncpu
This adds:
Various lesser-used HTTP status codes to the HttpStatusCode enumeration.
Getter and setter for customErrorHandler, which is a function that generates a HttpResponsePtr given an HttpStatusCode. This is intended to be similar to the custom404 functionality, allowing a user to override the layout of the error page.
The custom404 functions were kept even though this supersedes that to avoid breaking current code.
Finally, all of the Routers were updated to use the error handler for their 405/403 responses.
If no custom error handler is set, a default is used. The default behavior is identical to what exists now, an empty body with the status code set.
Add getHomePage to HttpAppFramework to help with SPA in scenarios a controller must take a certain action on passed parameters but redirect to homepage
This change greatly reduces the time between multiple Drogon runs
while developing an application with the framework. Previously on a
relaunch the framework naively compiled all *.csp files if dynamic
view loading was turned on. Now there will be a check for modification
time and the compilation phase will only run if the
corresponding *.csp file is newer than the dynamic library.
Co-authored-by: Rafał Bugajewski <rb@cocobit.software>