-
Notifications
You must be signed in to change notification settings - Fork 1
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
Use Content-Length header more often. #102
Conversation
src/request.toit
Outdated
slash := (path.starts_with "/") ? "" : "/" | ||
body_writer := connection_.send_headers | ||
"$method $slash$path HTTP/1.1\r\n" | ||
headers | ||
--is_client_request=true | ||
--content_length=content_length | ||
--has_body=(body != null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should use has_body here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
body_writer_.write data | ||
|
||
write_headers_ status_code/int --message/string? --has_body/bool: | ||
write_headers_ status_code/int --message/string? --content_length/int? --has_body/bool: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would save code to have content_length default to null here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keeping as is, to make callers think about the content-length.
We can't get the content-length in the write method because this is a method that can be called more than once. Fix some types in the test.
No description provided.