Skip to content
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

Change Content-Type header key to properly parse json response #50

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mationorato
Copy link

@mationorato mationorato commented Jan 29, 2025

Hey, I found an error that was causing the callback response not to be properly decoded.

It seems that the Twitter API changes the content-typeresponse header to Content-Type. Causing the callback request handling to fail at detecting when was needed to decode the response body from json.

@mationorato mationorato requested a review from a team as a code owner January 29, 2025 12:54
@yordis
Copy link
Member

yordis commented Jan 29, 2025

This shouldn't be the case since everything suppose to be normalized to downcased version. Could share more information and ideally create a unit test to prove such situation?

@mationorato
Copy link
Author

Hey! Yes, I must admit that this looks weird to me too, specially since It is not the first time I'm using this library for a project, but the response.headers are not arriving in lowercase to

def decode_body({:ok, response}) do
.

Not sure it is easy to setup a test on this, But i can share a demo of whats going on in a few hours.

@mationorato
Copy link
Author

mationorato commented Jan 29, 2025

@yordis
Copy link
Member

yordis commented Jan 29, 2025

HTTPoison ... this is old code ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants