jetzig-framework / jetzig

Jetzig is a web framework written in Zig
MIT License
308 stars 15 forks source link

Added cookie options #82

Closed drsneed closed 3 weeks ago

drsneed commented 3 weeks ago

Hello. I added the ability to specify cookie options in the jetzig config. I added all the options specified here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie. The default set-cookie output matches the previous output if no config changes are made.

bobf commented 3 weeks ago

@drsneed Thanks a lot for the PR. I've refactored a little to remove some allocs (and also to add some allocs). Cookie flags are now parsed as well, so each flag can be inspected if needed. Also added some tests.

Can you let me know if you think your original logic is retained ? I don't think I've broken anything but if you could confirm that would be appreciated (any other feedback on my changes is also welcome).

drsneed commented 3 weeks ago

@bobf, yes all logic is retained. Looks great! Thank you!

bobf commented 3 weeks ago

I think you closed the PR by accident. :)

I re-opened - will merge once builds have passed.