A default response body #114

sublee opened this Issue Sep 7, 2010 · 1 comment


None yet

2 participants

sublee commented Sep 7, 2010

First, I used this code in a private page:

headers = {"WWW-Authenticate": 'Basic realm="Login Required"'}
return Response(status=401, headers=headers)

It works well with werkzeug default container, but it has a problem with meinheld container.
When I request the page on meinheld, I got an "Internal Server Error" and error message:

[error] pid ..., File "meinheld/server/response.c", line 605 :TypeError: response item must be a string

I tried to find the cause and I found it.

Flask's Response class has a response parameter, it has the default value of None.
I think that a response body in the WSGI interface must be a basestring. So I suggest
to change response parameter's default value to ""(a blank string).

DasIch commented Jul 26, 2014

The .response attribute should be an empty list nowadays and not None. Despite that it's also irrelevant for this issue, as the web server should only care about the iterator returned when flask calls the response object with the environ and start_response function.

Given that there has been no activity on this issue for almost 4 years, I'm closing this until someone can reproduce it.

@DasIch DasIch closed this Jul 26, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment