zigzap / zap

blazingly fast backends in zig
MIT License
1.98k stars 71 forks source link

Parse Accept #100

Closed desttinghim closed 2 months ago

desttinghim commented 2 months ago

Parses the Accept field from the header to return the ranked list of content types the client expects. I'd like feedback on the API - it doesn't seem quite right to me yet.

renerocksai commented 2 months ago

BTW really nice work! I like it! I especially like the catch break stuff!

renerocksai commented 2 months ago

^^^ I just pushed a suggestion commit to this PR

renerocksai commented 2 months ago

^^^ that last commit was meant for master 🤣

desttinghim commented 2 months ago

I liked your changes, I've done a little more work on top of them. I count the number of commas up front and allocate the array list. The comma to item relationship should hold for all valid Accept headers I think.

renerocksai commented 2 months ago

Nice! Ready to merge if you are.

desttinghim commented 2 months ago

Lets get it merged then :)