valeriangalliat / fetch-cookie

Decorator for a `fetch` function to support automatic cookie storage and population. 🍪
The Unlicense
135 stars 29 forks source link

Fix empty cookie header #63

Closed Jackymancs4 closed 3 years ago

Jackymancs4 commented 3 years ago

Hello @valeriangalliat A project that I use utilize your package to send requests, and some very picky servers are giving me problems.

After some investigations, it appears that when no cookie is specified the Cookie header is still created and sent empty in the form cookie: ''. According to https://tools.ietf.org/html/rfc6265#section-5.4 and https://datatracker.ietf.org/doc/html/rfc6265#section-4.2.1 this should not be the case, and in fact some servers returns error 400 BAD_REQUEST.

This PR aims to fix this.

Please let me know what you think, and thank you.

valeriangalliat commented 3 years ago

Awesome, thanks a lot! I'm gonna release this shortly

valeriangalliat commented 3 years ago

Aaaand it's live on 1.0.0 (I know it's not breaking but I think it was about time to drop the 0.* version 😄)

Jackymancs4 commented 3 years ago

Nice, thank you! FYI the project in question is https://github.com/edrlab/thorium-reader. I'm going to make some tests and then propose the update.

Also, I'm giving a look at your youtube channel, some interesting stuff. Listening to your Chill playlist right now!

valeriangalliat commented 3 years ago

Hahaha, enjoy!