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

End of Response #2

Open
hendrikebbers opened this issue Mar 10, 2017 · 4 comments
Open

End of Response #2

hendrikebbers opened this issue Mar 10, 2017 · 4 comments
Assignees

Comments

@hendrikebbers
Copy link
Collaborator

I haven't tested it until know but it looks to me that currently the end of a response in the stream is found by searching for 2 line feeds. I think this is wrong since the payload of a response can contain several line feeds in the data. As far as I know each request / response has a content length field that defines the size of the content / payload (in bytes / characters?). I think this must be checked to find the end of a request / reponse, right?

@Oliver-Loeffler
Copy link
Owner

Yes, that was my first attempt. Well, I'll fix this aspect tonight. As of now, only the first 1024 bytes are considered for reading the response. There is no valid mechanism yet to read the payload. So HttpResponse is not complete yet as it only covers the header fields.

@hendrikebbers
Copy link
Collaborator Author

hendrikebbers commented Mar 10, 2017 via email

@Oliver-Loeffler
Copy link
Owner

So far reading stopped intentionally as I used this to explore how HTTP response headers look alike. I should be able to do something about this weekend.

@Oliver-Loeffler
Copy link
Owner

Oliver-Loeffler commented Mar 10, 2017

I found the particular section in the RFCs.

In current implementation only the "header end" is determined correctly (CRLF+CRLF prior to payload body). The payload is currently simply what can be read from channel as long as it is open. In case of multiple consecutive messages this won't work. So here clearly some work has to be done.

I will consider all the boundary conditions and cases in section 3.3.3 message body length during writing of a request builder or producer.

Is there any kind of java based HTTP/1.1 HTTP/2 or HTTPS server which can be used as endpoint for integration testing and protocol exploration, something which can be integrated in a Maven flow? This would eliminate the need of having a separate server running or to confuse real-world servers with strange requests. Or is that over engineered?

Those HTTP Response and Request objects, shall they behave nicely conform to RFCs or just provide the data (responses) and handles for any kind of free form request building?

@Oliver-Loeffler Oliver-Loeffler self-assigned this Mar 11, 2017
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

2 participants