Comments (15)
Is your request an HTTP/1.1 request? Web servers follow the HTTP specification, which indicates that responses will use the same HTTP version as specified in the request.
from waitress.
Chris,
The header we send says HTTP/1.1 and what we get back is HTTP/1.0. We are running the latesst waitress available.
Chuck
From: Chris McDonough [email protected]
To: Pylons/waitress [email protected]
Cc: Chas. [email protected]
Sent: Tuesday, November 13, 2012 3:20 PM
Subject: Re: [waitress] Header for Waitress (#4)
Is your request an HTTP/1.1 request? Web servers follow the HTTP specification, which indicates that responses will use the same HTTP version as specified in the request.
—
Reply to this email directly or view it on GitHub.
from waitress.
You'll need to provide something replicable to chase down. Please make double-dog-sure that you're sending a valid HTTP/1.1 request. I have ~400 tests for this sort of behavior that all pass.
from waitress.
Do you happen to have a test I can run? I'd like to show the client programmer that it does what is advertised.
Thanks,
Chuck
From: Chris McDonough [email protected]
To: Pylons/waitress [email protected]
Cc: Chas. [email protected]
Sent: Tuesday, November 13, 2012 3:25 PM
Subject: Re: [waitress] Header for Waitress (#4)
You'll need to provide something replicable to chase down. Please make double-dog-sure that you're sending a valid HTTP/1.1 request. I have ~400 tests for this sort of behavior that all pass.
—
Reply to this email directly or view it on GitHub.
from waitress.
The tests can be run via setup.py test.
from waitress.
Chris,
Here is a trace from curl:
cwegrzyn@einstein ~/RESTful/CLI $ curl -v http://127.0.0.1:9000/login --header "Accept: application/json" --user Test:smartlink
- About to connect() to 127.0.0.1 port 9000 (#0)
- Trying 127.0.0.1...
- connected
- Connected to 127.0.0.1 (127.0.0.1) port 9000 (#0)
- Server auth using Basic with user 'Test'
GET /login HTTP/1.1
Authorization: Basic VGVzdDpzbWFydGxpbms=
User-Agent: curl/7.28.0
Host: 127.0.0.1:9000
Accept: application/json
ERROR:waitress:Exception when serving /login
Traceback (most recent call last):
File "/usr/lib64/python2.7/site-packages/waitress-0.8.1-py2.7.egg/waitress/channel.py", line 329, in service
task.service()
File "/usr/lib64/python2.7/site-packages/waitress-0.8.1-py2.7.egg/waitress/task.py", line 173, in service
self.execute()
File "/usr/lib64/python2.7/site-packages/waitress-0.8.1-py2.7.egg/waitress/task.py", line 380, in execute
app_iter = self.channel.server.application(env, start_response)
File "/home/cwegrzyn/RESTful/routing.py", line 70, in call
return route.target(environ, start_response)
File "/home/cwegrzyn/RESTful/connectThread.py", line 145, in getLogin
d = queryString(environ['QUERY_STRING'])
File "/home/cwegrzyn/RESTful/support.py", line 90, in queryString
a = kvEval(i)
File "/home/cwegrzyn/RESTful/support.py", line 59, in kvEval
if len(parts[1]) == 0:
IndexError: list index out of range - HTTP 1.0, assume close after body
< HTTP/1.0 500 Internal Server Error
< Connection: close
< Content-Length: 110
< Content-Type: text/plain
< Date: Tue, 13 Nov 2012 13:56:26 GMT
< Server: waitress
<
Internal Server Error
You can see the HTTP/1.0 in the error response.
Chuck
From: Chris McDonough [email protected]
To: Pylons/waitress [email protected]
Cc: Chas. [email protected]
Sent: Tuesday, November 13, 2012 3:25 PM
Subject: Re: [waitress] Header for Waitress (#4)
You'll need to provide something replicable to chase down. Please make double-dog-sure that you're sending a valid HTTP/1.1 request. I have ~400 tests for this sort of behavior that all pass.
—
Reply to this email directly or view it on GitHub.
from waitress.
OK, this is a bit of a corner case due to the error being raised downstream. I'd have to consult the spec to see what the right thing to do is. I presume what you want is to be able to fire a bunch of pipelined requests at the application and even if one generates an exception, to allow for the processing of the remainder. A workaround in the meantime is to catch exceptions in the application you're serving and return a 500 response yourself instead of relying on Waitress to generate one for you. Another suggestion would be to try a different WSGI server that claims to support HTTP/1.1 (maybe gunicorn) and see if that fixes the problem.
Thanks for the report.
from waitress.
Chris,
We know in cases where the request works the server does indeed return
HTTP/1.1. We were surprised in the error return case to see the
HTTP/1.0. I thought so long as we asked for 1.1 we'd get 1.1 in return
and when we didn't the QA code raised an error.
Chuck
On 11/13/2012 4:08 PM, Chris McDonough wrote:
OK, this is a bit of a corner case due to the error being raised
downstream. I'd have to consult the spec to see what the right thing
to do is. I presume what you want is to be able to fire a bunch of
pipelined requests at the application and even if one generates an
exception, to allow for the processing of the remainder. A workaround
in the meantime is to catch exceptions in the application you're
serving and return a 500 response yourself instead of relying on
Waitress to generate one for you. Another suggestion would be to try a
different WSGI server that claims to support HTTP/1.1 (maybe gunicorn)
and see if that fixes the problem.Thanks for the report.
—
Reply to this email directly or view it on GitHub
#4 (comment).
from waitress.
I understand. If you need it right away, please try the workarounds I listed above or attempt to supply a fix.
from waitress.
Chris, it was more to inform you of what we found. What I will probably
do is fix it on my end waiting for the official release from you.
Chuck
On 11/13/2012 5:14 PM, Chris McDonough wrote:
I understand. If you need it right away, please try the workarounds I
listed above or attempt to supply a fix.—
Reply to this email directly or view it on GitHub
#4 (comment).
from waitress.
Marking as sprintable. The sprint task is figuring out what the right thing to do is.,
from waitress.
Sofar there are 2 cases that revert to HTTP 1.0:
- wrong HTTP headers in the request
- InternalServerError cases
from waitress.
The fix above isn't quite right because we don't want to close the connection if there are still requests in the queue.
from waitress.
wrong HTTP headers in the request case: we decided with @mcdonc to leave it as it is. That request is just broken.
from waitress.
InternalServerError case solved
from waitress.
Related Issues (20)
- Test failure (DispatcherWithSendTests.test_send) with "Possible SYN flooding" in dmesg HOT 1
- waitress server stuck HOT 1
- HTTP allowed methods are not be configured in waitress HOT 3
- Support VSOCK sockets
- Waitress thread does not respect daemon property. HOT 1
- waitress-servce consume 100% cpu HOT 2
- File not found from waitress\wasyncore.py HOT 3
- Error: No such option --listen HOT 7
- clarity on client_disconnected usage HOT 1
- Via header cannot be removed if the application sets the Server header HOT 7
- 100% cpu in mainthread due to not closing properly? (channel.connected == False) HOT 94
- backlog parameter not working HOT 2
- Receive error 413 Request entity is too large HOT 3
- Warning 434 HTTPTooManyRequests HOT 1
- IIS configuration as reverse proxy HOT 1
- Errors while deploying on an IIS Server HOT 1
- Broken connections with many concurrent `HEAD` requests HOT 3
- IIS Deploy Django App, python.exe error HOT 1
- `\xa0` and `\x85` are stripped from the ends of header values HOT 1
- [Question] Waitress and Flask (Werkzeug) ProxyFix interaction HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from waitress.