-
Notifications
You must be signed in to change notification settings - Fork 36
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
Fix duplicate header issue #149
Fix duplicate header issue #149
Conversation
This may also resolve: #40 |
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.
Hi - several suggestions.
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.
This looks good to me. Thanks for the fix @justmobilize!
I confirmed the duplicated Content-Type header issue with a simple http server and wireshark to view the raw TCP data stream. I tried a few other things before resorting to wireshark, but flask and a few of the other basic server examples I tried made it difficult for me to see the raw request. Many of them treat headers as dictionary-like so it seems to resolve duplicates without much trouble.
I confirmed the fix does successfully get rid of that duplicated header.
All testing was was done on a QTPy ESP32-S2 8.2.9
Thanks for testing! And happy to do this (and I hope a bunch more) |
Looks like all requested changes have been addressed. Merging this one. Thanks again for all of your work on this @justmobilize! |
Updating https://github.com/adafruit/Adafruit_CircuitPython_Requests to 2.0.4 from 2.0.3: > Merge pull request adafruit/Adafruit_CircuitPython_Requests#149 from justmobilize/fix-duplicate-header-issue Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA: > Updated download stats for the libraries
When helping a member in the discord channel
#help-with-circuitpython
, I had made the mistake of thinking that this library didn't automatically deal with turning adict
into aurlencoded
string. I had them convert it by hand and try and it worked.As it turns out - it does, but also sends the header
Content-Type: application/x-www-form-urlencoded
, which some systems (Spotify
as one) can't handle getting the header twice.This would fix issue #148
Test:
Using the main branch of
Adafruit_CircuitPython_Requests
, this will return a400
because it sendsContent-Type
twice, using this branch will succeed