Commit Graph

1280 Commits

Author SHA1 Message Date
An Tao fda2719dd4
Fix the session bug introduced in PR #523 (#528) 2020-08-06 19:35:30 +08:00
An Tao 80a8f62e30
Change the type of result from the mktime() function in model source code (#524) 2020-08-05 20:01:51 +08:00
An Tao dddc62a9fe
Fix a mysql issue when connections are lost (#525) 2020-08-04 20:04:43 +08:00
An Tao 43a21ddc9c
Provide users with a method to change the session ID of a session (#523) 2020-08-03 19:18:47 +08:00
An Tao 820715cd62
Set session to requests for websockets (#521) 2020-07-31 09:25:20 +08:00
An Tao 5e35055379
Build release version in docker (#520) 2020-07-30 16:27:35 +08:00
An Tao 34cefefce4
Modify parseContentType function (#518) 2020-07-25 10:01:06 +08:00
An Tao 5bd85170bf
Fix a bug when saving uploaded files on Windows (#514) 2020-07-17 13:18:52 +08:00
an-tao dd66ba5a73 Bump version to 1.0.0-beta19 2020-07-16 21:07:00 +08:00
An Tao c8640700ea
Add the getJsonError method (#507)
* Add the getJsonError method to the HttpRequest and the HttpResponse classes
2020-07-09 19:50:30 +08:00
An Tao 9d3efeac67
Optimize the HttpResponse class (#505) 2020-07-06 08:39:20 +08:00
An Tao 9c54fb8c69
Modify generation of models and the DbClient class (#498)
* Add setter method for automatical fields of models

* Put SQL queries into buffer before any connection being established

* Update trantor
2020-07-03 12:19:40 +08:00
An Tao f871d1607d
Modify static files router and 404 pages generator (#497)
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;
2020-07-02 09:59:17 +08:00
Rick Zhuang 630beed867
Add the header <cctype> to resolve build errors in VS2017 (#495) 2020-06-27 11:43:49 +08:00
An Tao 306c072af7
Add a timeout parameter when sending HTTP requests (#493) 2020-06-27 09:45:14 +08:00
An Tao 8f6269b208
Add a method to disable unicode escaping in json string (#491) 2020-06-24 08:11:32 +08:00
An Tao ccd51d289e
Destroy DNS resolver of HttpClient in the correct thread (#490) 2020-06-22 19:55:24 +08:00
An Tao 3424d3f2c4
Add a way to set the character set when creating DbClient objects (#486) 2020-06-20 20:21:14 +08:00
An Tao 56b5d03fed
Remove the restriction on the location of layout tags in views (#484) 2020-06-18 21:44:54 +08:00
An Tao a9f4bff519
Properly handle chunked encoding requests. (#479) 2020-06-16 20:36:31 +08:00
itgenie98 2607f35687
Fix CORS for new HTTP PATCH method (#477)
* 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
2020-06-15 10:05:05 +08:00
antao fda6a443a8 Bump version to 1.0.0-beta18 2020-06-14 23:20:35 +08:00
itgenie98 14b5ec08ee
Add HTTP PATCH method (#476) 2020-06-14 21:57:25 +08:00
An Tao 2457f9b413
Add a method for the TERM signal handling (#475) 2020-06-14 17:36:10 +08:00
An Tao 4ebb72b0cf
Fix a bug with quoted column names in sqlite3 databases when using 'drogon_ctl create model'(#474) 2020-06-14 09:13:49 +08:00
Rafał Bugajewski 9e959397af
Fixed Model Generation for PostgreSQL Primary Keys (#471)
As per definition Drogon should return the last ID after an insert
when “a table contains an auto-increasing primary key”, but the
current detection mechanism isn’t enough to catch all cases.

PostgreSQL has the concept of generated identity columns that act as
primary key columns, but this information is held in the "is_identity"
column that wasn’t checked before.

This commit fixes #410, and also detects generated identity columns as
auto incrementing columns, so that the model generation correctly
appends " returning " statements.
2020-06-10 23:55:03 +08:00
An Tao e7b7618c37
Use string_view to parse multipart/form-data requests (#469) 2020-06-10 11:11:24 +08:00
antao be6f0966d5 Fix a compilation issue on windows 2020-06-09 10:09:17 +08:00
An Tao b3d1f151b5
Fix the count() method of Mysql ORM (#468) 2020-06-09 00:54:12 +08:00
adrian fd2a612945
add digest filter in examples (#462)
* 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>
2020-06-07 14:43:05 +08:00
ihmc3jn09hk bbef8780fd
Fix a bug in ListenerManager::getIOLoop() (#461)
Co-authored-by: antao <antao2002@gmail.com>
2020-06-06 12:59:54 +08:00
An Tao e015439740
Add a new joinpoint of AOP for modification on each HTTP response (#460) 2020-06-06 12:25:21 +08:00
An Tao ecb3d3f74f
Make app().run() method callable on a non-main thread (#457) 2020-06-06 12:24:06 +08:00
VayuDev d4d5adf88b
Added additional formats for getHttpDate function and fixed undefined behavior upon error (#453) (#456)
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>
2020-06-05 20:57:36 +08:00
An Tao 5faab6b414
Modify the WebSocketConnection class (#452)
* Add getContextRef method to the WebSocketConnection class

* Expose some functions on Windows

* Send a close message when closing a web socket connection
2020-06-04 19:11:07 +08:00
An Tao adab48e187
Fix a Mysql connection error on Windows (#449) 2020-06-02 22:05:03 +08:00
antao c2f6aa0109 Update the trantor library 2020-05-31 18:33:23 +08:00
Rafał Bugajewski 598d8c15b3
Added Initial Contribution Recommendations (#445)
Co-authored-by: antao <antao2002@gmail.com>
2020-05-25 21:05:05 +08:00
Vedran Miletić e286fe869a
Fix building of ORM on FreeBSD (#444) 2020-05-25 00:00:00 +08:00
antao 49472a3cc4 Create a class template for publish subscribe pattern (#443) 2020-05-24 20:42:00 +08:00
antao 84e503a948 Bump version to 1.0.0-beta17 2020-05-23 10:47:24 +08:00
Erez Oxman d43c2976ff
Changed link in readme.md from doxiz to docsforge (#442) 2020-05-22 00:00:07 +08:00
An Tao 7b1712003d
Modify drogon_ctl to show more compilation information (#441) 2020-05-21 21:14:40 +08:00
Vedran Miletić 375498a5a6
Fixes for FreeBSD (#440)
* 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
2020-05-20 22:29:37 +08:00
Zach Hilman c754d65cf0
Add additional HttpStatusCodes and implement a custom error handler (#439)
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.
2020-05-19 11:50:44 +08:00
An Tao 4423d836f4
Add methods to get DbClient connection status (#436) 2020-05-18 08:31:18 +08:00
An Tao 26dca0a910
Fix a connection bug of mariadb clients (#438) 2020-05-17 21:08:12 +08:00
An Tao cddd17eb55
Fix some compilation warnings (#432) 2020-05-16 10:11:50 +08:00
antao 84eb05ce38 Update trantor 2020-05-10 18:41:42 +08:00
Rafał Bugajewski 398b028046
Pass Data From View to Its Layout Container (#429) 2020-05-09 14:13:20 +08:00