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

Conversation

2 participants
@yohanboniface
Member

yohanboniface commented Nov 15, 2017

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.

@yohanboniface yohanboniface requested a review from davidbgk Nov 15, 2017

@@ -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,

This comment has been minimized.

@yohanboniface

yohanboniface Nov 15, 2017

Member

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

Add an exception to deal with Set-Cookie header
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

This comment has been minimized.

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 referenced this pull request Nov 20, 2017

Closed

"built-in" headers #26

@yohanboniface

This comment has been minimized.

Member

yohanboniface commented Nov 20, 2017

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

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@yohanboniface yohanboniface deleted the set-cookie branch Nov 20, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment