rs / curlie

The power of curl, the ease of use of httpie.
https://curlie.io
MIT License
2.86k stars 97 forks source link

fix headers/body order in console #55

Closed mateusz834 closed 1 year ago

mateusz834 commented 2 years ago

Normally curlie returns output like that (as expected):

[mateusz@arch curlie (fix)]$ curlie localhost:8080
HTTP/1.1 200 OK
Date: Fri, 20 May 2022 19:35:04 GMT
Content-Length: 30
Content-Type: text/plain; charset=utf-8

Hello
Hello
Hello
Hello
Hello

But sometimes it returns like so: (around 5% of responses)

[mateusz@arch curlie (fix)]$ curlie localhost:8080
Hello
Hello
Hello
Hello
Hello
HTTP/1.1 200 OK
Date: Fri, 20 May 2022 19:35:40 GMT
Content-Length: 30
Content-Type: text/plain; charset=utf-8

For me it only happens when querying localhost (probably because of the low latency??). This PR fixes it.

blackheaven commented 1 year ago

can it be merged?