Skip to content

Deviation from the Faraday adapter specification #46

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

Closed
ebababi opened this issue Jan 21, 2025 · 3 comments
Closed

Deviation from the Faraday adapter specification #46

ebababi opened this issue Jan 21, 2025 · 3 comments
Assignees
Milestone

Comments

@ebababi
Copy link
Contributor

ebababi commented Jan 21, 2025

Faraday adapters are expected to represent empty body response as blank string, but async-http-faraday deviates from this specification.

@ioquatix
Copy link
Member

ioquatix commented Jan 21, 2025

I am okay if you want to submit a PR to make this gem more consistent with the Faraday spec. However, there can be some difference between a response with an empty body (content-length: 0) and no body (e.g. HTTP/2 headers frame with stream close flag).

cc @iMacTia wdyt?

ebababi added a commit to ebababi/async-http-faraday that referenced this issue Jan 22, 2025
ebababi added a commit to ebababi/async-http-faraday that referenced this issue Jan 22, 2025
@ioquatix ioquatix self-assigned this Jan 23, 2025
@ioquatix ioquatix added bug Something isn't working and removed bug Something isn't working labels Jan 23, 2025
@ioquatix
Copy link
Member

Released in v0.20.0.

@ioquatix ioquatix added this to the v0.20.0 milestone Jan 23, 2025
@iMacTia
Copy link

iMacTia commented Jan 24, 2025

There can be some difference between a response with an empty body (content-length: 0) and no body (e.g. HTTP/2 headers frame with stream close flag).

I'm open to exploring what it would mean in Faraday to support the nil body case, but I fear it may have important repercussions.
One possible trick we could use is to allow adapters to return nil, and then Faraday turns that into ''.
This way the behaviour is preserved, but if one day we decide to treat those scenarios in a different way, we just need to change Faraday without having to change all adapters as well

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

No branches or pull requests

3 participants