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

Chunked responses #27

Open
back2dos opened this issue May 24, 2016 · 7 comments
Open

Chunked responses #27

back2dos opened this issue May 24, 2016 · 7 comments

Comments

@back2dos
Copy link
Member

This came up in #18.

To my understanding, this could be implemented as a function of type OutgoingResponse->OutgoingResponse. If the argument already has a Content-Length it would be returned as is, otherwise a new response would be constructed that uses chunked encoding. The tricky bit is in writing the IdealSource->IdealSource transformation for the body.

Not sure when I'll get around to do this. Volunteers are welcome. Or let me know if this becomes a pressing issue ;)

@kevinresol
Copy link
Member

kevinresol commented May 28, 2017

was trying to implement OutgoingResponse.chunked(). It turns out that nodejs uses chunked encoding by default, meaning that one doesn't need to set content-length nor transfer-encoding header. Simply write() to the ServerResponse object and end() it, nodejs will take care of the rest (adda transfer-encoding: chunked header and sends body in chunked style).

So if we transform the body into "chunked style" and send through nodejs, it will be shown "as-is" on the receiver side.

So I mean this should probably be handled at container level

@back2dos
Copy link
Member Author

So I mean this should probably be handled at container level

Yes and no. First, there should be a standalone functionality that is of type IncomingRequestHeader->OutgoingReponse->OutgoingResponse that is able to fix a response so that makes sure the content-length, transfer-encoding and connection headers fit with one another and what the client supports (e.g. support for chunked responses must be announced by the client IIRC, otherwise connection: closed must be used).

@bablukid
Copy link

bablukid commented Dec 4, 2019

same problem here, tink_http ( PHP7 target ) throws the same error when acessing Google Geocoding API ( i.e "https://maps.googleapis.com/maps/api/geocode/json?address=Place%20de%20l%27%C3%A9toile%20Paris" )

Error#500: Chunked encoding is not supported and the content-length header is required. @ tink.http.clients.SocketClient.request:74

@0b1kn00b
Copy link

Wait, Why are both these issues closed?

@back2dos
Copy link
Member Author

Which ones? ^^

@0b1kn00b
Copy link

0b1kn00b commented Apr 25, 2020

Regarding SocketClient not supporting chunked responses. Got bogged down with the Chunked implementation thus far.

@kevinresol
Copy link
Member

chunked encoding is not implemented in the SocketClient right now, and this issue is an umbrella covering that and all other chunk-related things.

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

4 participants