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

Add an exception to deal with Set-Cookie header #23

Merged
merged 1 commit into from
Nov 20, 2017
Merged

Conversation

yohanboniface
Copy link
Member

According to https://tools.ietf.org/html/rfc7230#page-23,
Set-Cookie is the only response header field that can appear
multiple times.
So let's deal with that as an exception to keep normal perf
in normal case.

@@ -61,6 +61,14 @@ response.status = 204
response.status = http.HTTPStatus.OK
```
- **headers** (`dict`): case sensitive HTTP headers

*`Set-Cookie` exception*: if you want to set multiple `Set-Cookie` headers,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should actually change when we'll have a proper cookie management.

@yohanboniface yohanboniface force-pushed the set-cookie branch 2 times, most recently from 8e749d6 to dbd3ad0 Compare November 15, 2017 22:14
According to https://tools.ietf.org/html/rfc7230#page-23,
Set-Cookie is the only response header field that can appear
multiple times.
So let's deal with that as an exception to keep normal perf
in normal case.
@davidbgk
Copy link
Contributor

davidbgk commented Nov 15, 2017

In the process of trying to add more tests, I wondered if some response headers are required. It appears that none is really required but a few are advised. Don't know where we want to go and that's probably not relevant in that PR, that's more to discuss.

Somehow related: an empty response is currently b'HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n' maybe we can remove the Content-Length: 0 in that case?

@yohanboniface yohanboniface mentioned this pull request Nov 20, 2017
@yohanboniface
Copy link
Member Author

Don't know where we want to go and that's probably not relevant in that PR, that's more to discuss.

#26

Somehow related: an empty response is currently b'HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n' maybe we can remove the Content-Length: 0 in that case?

I'm tempted to say yes, but it may be that some clients user Content-Length: 0 as a way to know there is no body to come (neither a stream I mean) ? Anyway, let's discuss this in #26.

@yohanboniface yohanboniface merged commit a43c1d8 into master Nov 20, 2017
@yohanboniface yohanboniface deleted the set-cookie branch November 20, 2017 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants