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.