Comments (14)
Thanks for reporting, @jordan0day. I will take a look later today and give you some feedback.
I suspect it's an issue on hackney, but I can't confirm without writing some tests on hackney.
from httpoison.
Just released 0.6.0 version that requires hackney ~> 1.0 and it will (from today) get a version higher than 1.0.6 which fixed this behaviour. Thanks to @lexmag for fixing this on hackney.
I tested on my machine. If you find the same behaviour after using hackney 1.0.6 please reopen the issue.
from httpoison.
@edgurgel my pleasure to help.
from httpoison.
🏆 Thanks @edgurgel and @lexmag!
from httpoison.
Using HTTPoison 0.7.0 and hackney 1.1.0 I don't get AsyncEnd message ever. The server does not send Content-length header and the only way to detect the end of a download is that at the end I got an AsyncChunk with an empty string. Is it intended?
from httpoison.
It's not intended. I will reopen the issue and investigate. Thanks for reporting.
from httpoison.
The problematic link is the ElixirSips XML feed (elixirsips.com). I'm afraid you have to be subscribed to access that link (required basic_auth), so I cannot provide it for you.
from httpoison.
I have an ElixirSips subscription, and can replicate DavsX issue -- seeing the Async response streamed, and when it comes to the end, you get a final AsyncChunk with an empty string, and no AsyncEnd message sent.
Here's the AsyncStatus, AsyncHeaders messages:
%HTTPoison.AsyncStatus{code: 200, id: #Reference<0.0.0.2394>}
%HTTPoison.AsyncHeaders{headers: [{"Date", "Mon, 20 Jul 2015 16:25:45 GMT"}, {"Server", "Apache"}, {"Set-Cookie", "symfony=[...snip...] path=/; HttpOnly"}, {"Expires", "Thu, 19 Nov 1981 08:52:00 GMT"}, {"Cache-Control", "no-store, no-cache, must-revalidate, post-check=0, pre-check=0"}, {"Pragma", "no-cache"}, {"Vary", "Accept-Encoding,User-Agent"}, {"P3P", "CP=\"NOI CURa OUR NOR UNI\""}, {"Connection", "close"}, {"Content-Type", "application/rss+xml; charset=UTF-8"}], id: #Reference<0.0.0.2394>}
So it appears to be the same issue, only worse, because this server isn't even setting a content-length or transfer-encoding header on a 200 OK
response.
from httpoison.
@jordan0day thank for the infinitely better-than-mine bug description :)
from httpoison.
Thanks! This is enough to reproduce the error. 👍
from httpoison.
Good news. This was fixed with hackney 1.2.0. A simple mix deps.update hackney
should do the job. I will set hackney to "~> 1.2" so nobody will have these problems.
Using hackney 1.2.0:
Running the 1 line "server"
{ echo -ne "HTTP/1.0 200 OK\r\n\r\n"; echo "BODY"; } | nc -l localhost 8080
iex(3)> HTTPoison.get!("http://localhost:8080", [], [stream_to: self])
%HTTPoison.AsyncResponse{id: #Reference<0.0.4.251>}
iex(4)> flush
%HTTPoison.AsyncStatus{code: 200, id: #Reference<0.0.4.251>}
%HTTPoison.AsyncHeaders{headers: [], id: #Reference<0.0.4.251>}
%HTTPoison.AsyncChunk{chunk: "BODY\n", id: #Reference<0.0.4.251>}
%HTTPoison.AsyncChunk{chunk: "", id: #Reference<0.0.4.251>}
%HTTPoison.AsyncEnd{id: #Reference<0.0.4.251>}
:ok
from httpoison.
Good to hear! I'll try it myself, when I'll have the time.
from httpoison.
I confirm, that it is working :ok
from httpoison.
Awesome! Thanks! 👍
from httpoison.
Related Issues (20)
- Response HOT 2
- Request is getting closed. HOT 2
- HTTPoison.MaybeRedirect for 308 status_code ? HOT 11
- why no_proxy doesn't support CIDR range format?
- checkout_failure when using httpoison with proxy HOT 3
- Lowercase location header not recognized when constructing %HTTPoison.MaybeRedirect{}
- TLS client: In state wait_cert_cr at ssl_handshake.erl:1984 generated CLIENT ALERT: Fatal - Unknown CA HOT 3
- SSL options replace default options (instead of just being added to them) HOT 2
- Default TLS version? HOT 2
- Proxy option not working HOT 1
- Hackney 1.18? HOT 1
- Overly loose typespecs
- HTTPoison.get! follow_redirect does not work with an async request HOT 1
- Nested form-encoded params don't work HOT 2
- "Path not supported by Algolia REST API" HOT 2
- How to contribute HOT 1
- ipv6 localhost address is passed to hackney without square brackets HOT 1
- Get HTTPoison.Error{reason: {:options, :dependency}} when send request with settings for tlsv1.3
- Issue Case clause error
- Multipart content based post failing if the file name contains space or () characters HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from httpoison.