-
-
Notifications
You must be signed in to change notification settings - Fork 383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cookieparser attributes #409
Conversation
I haven't looked too deeply into the code but have you considered |
I didn't want to resort to 3rd party libraries initially so I looked at all of std (up to c++ 11/14) chronoChrono is more for tracking time than working with dates. Most of its features on the docs were added in c++20 when it was refreshed to support dates properly. Chronos timepoint is the only 11/14 struct to hold a datetime and it doesnt support any operations on it. The duration type is bound to a clock. c-styleDate operations in chrono are possible with a group of c-style functions and helper structs: As a whole, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition to the comments, it might be useful to create some documentation on how to use this middleware. (I can do that, you don't have to do it if you don't want to)
Thanks a lot for the work you've done here!
I've added an example for the cookie parser, as there previously weren't any. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I apologize, I just now got around to looking at the documentation. Aside from the comments, mkdocs.yml
needs to be changed as follows for the new guide to be built:
@@ -55,7 +55,7 @@ nav:
- Writing Tests: guides/testing.md
- Using Crow:
- HTTP Authorization: guides/auth.md
- - CORS Setup: guides/CORS.md
+ - Included Middlewares: guides/included-middleware.md
- Server setup:
- Proxies: guides/proxies.md
- Systemd run on startup: guides/syste.md
Aside from that everything seems to be in order :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything seems to be in order.
Thank you very much for your work!
b9b2592
to
84effa5
Compare
Crows cookie_parser currently doesn't support setting any attributes on cookies (most importantly expires and path). I've added support for all available HTTP cookie attributes.
This helps #406
Cookie parsers context allows now to set attributes in a builder style:
I've chosen boost for timepoints and durations as Crow already depends on it and
std::time_t
/std::tm
are just horribly difficult to use.