Skip to content
This repository has been archived by the owner on May 21, 2022. It is now read-only.

Disabling transfer-encoding: chunked #80

Closed
avaitla opened this issue Jan 3, 2021 · 4 comments
Closed

Disabling transfer-encoding: chunked #80

avaitla opened this issue Jan 3, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@avaitla
Copy link

avaitla commented Jan 3, 2021

Hello Team,

I've noticed an issue when using mojito to send post requests to a third party service: https://sheet.best/

When making a POST request with Mojito the service doesn't work, whereas the same post request sent from curl or httppoison does work (so it is not an issue with the third party service).

The reason the service doesn't work when requested with Mojito is due to Mojito forcing the transfer-encoding: chunked format on the request. I've written a quick gist comparing outputs between curl / httppoison / mojito: https://gist.github.com/avaitla/0d6fc2e1ee7a01325cda8e0e5dd28bae

Note that Mojito does NOT return the right results, since sheet.best cannot understand chunked transfer encoding.

Is there anyway that users of this library can disable this feature as not all external services (which we cannot control may not support this encoding).

Thank you,

  • Anil
@esvinson
Copy link
Contributor

We're seeing something similar. This looks like it was a breaking change in 0.7.6. If I revert back to our previous version (0.7.3 ) our requests work just fine. If we switch to the latest version (0.7.7) we start getting 404 errors from the login.microsoftonline.com authentication URL we're hitting.

@gamache
Copy link
Contributor

gamache commented Feb 17, 2021

Hm, this would be a consequence of #68, which forces chunked behavior in HTTP/1 as a side effect of implementing it in HTTP/2. It's not necessary to implement it this way; if it's causing problems like this, we should restore the original behavior.

@gamache gamache added the bug Something isn't working label Feb 17, 2021
@ihabunek
Copy link

This issue also breaks fetching auth keys from Apple, as their server returns a 403 when transfer-encoding: chunked header is sent.

Mojito.get("https://appleid.apple.com/auth/keys")                        

@ntenczar
Copy link
Contributor

Hi! This project is now deprecated:

We recommend that you use Finch which is also built on Mint. The creator of Finch has an excellent writeup here describing the problems with Mojito, and as a result we use Finch internally at Appcues now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants