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

Response should use the same HTTP version as the request #54

Open
fracek opened this issue May 14, 2014 · 1 comment
Open

Response should use the same HTTP version as the request #54

fracek opened this issue May 14, 2014 · 1 comment

Comments

@fracek
Copy link
Member

fracek commented May 14, 2014

At the moment if the request is version 1.0, we reply with HTTP version 1.1. e.g. curl --http1.0 -v localhost:8000/json (from techempower-benchmarks) returns

* About to connect() to localhost port 8000 (#0)
*   Trying ::1...
* Adding handle: conn: 0x1da8d10
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x1da8d10) send_pipe: 1, recv_pipe: 0
* Connection refused
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8000 (#0)
> GET /json HTTP/1.0
> User-Agent: curl/7.30.0
> Host: localhost:8000
> Accept: */*
> 
< HTTP/1.1 200 OK
< Content-Length: 27
< Date: Wed, 14 May 2014 09:32:49 +0200
* Server HTTP Server/0.9 is not blacklisted
< Server: HTTP Server/0.9
< Content-Type: application/json
< 
* Connection #0 to host localhost left intact
{"message":"Hello, World!"}

At the moment send-response-line uses the constant $http-version as the http version to use. I think this should be changed to be based on the http version of the request.

@fracek
Copy link
Member Author

fracek commented May 14, 2014

I think a function like response-version(response) would be useful. e.g. response-version(res) => #"http/1.1". At the moment we have to do response.response-request.request-version.

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

No branches or pull requests

2 participants