Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

TestApp.get should pass REQUEST_URI #1

Open
domenkozar opened this issue Nov 13, 2012 · 1 comment
Open

TestApp.get should pass REQUEST_URI #1

domenkozar opened this issue Nov 13, 2012 · 1 comment

Comments

@domenkozar
Copy link
Member

Anonymous:

A common workaround for unicode and slashes encoded in the URL
is to have the wsgi app server pass REQUEST_URI and then deal
with it in middleware. It would be nice to
be able to test said middleware.
For now, a workaround is to wrap TestApp.get and always specify
extra_environ={'REQUEST_URI':url}.

Ian Bicking:

This may be hard to implement correctly, as the request construction
deconstructs the URL, and that's happening in WebOb. I don't think
the change would be appropriate for WebOb itself. Also quite a lot
of WSGI servers at this point don't set REQUEST_URI, so always
having it on doesn't seem like a good idea (having it off is more
representative of lowest-common-denominator WSGI servers).
An option to turn it on seems okay though (something you can pass
in when instantiating TestApp).

URL: https://bitbucket.org/ianb/webtest/issue/8/testappget-should-pass-request_uri

@sirex
Copy link

sirex commented Jun 14, 2018

An option to turn it on seems okay though (something you can pass in when instantiating TestApp).

I'd like that. 👍

sirex added a commit to vaultit/qvarn that referenced this issue Aug 29, 2019
It turned out, that REQUEST_URI is not even in the WSGI spec and WSGI
servers might not provide it in request environ.

WebTest does not provide REQUEST_URI, that why I had to add it by
extending webtest.TestApp.

Pylons/webtest#1
gawel pushed a commit that referenced this issue Apr 30, 2020
Added new host property to _RequestCookieAdapter
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants