gawel / WSGIProxy2

A WSGI Proxy with various http client backends
https://wsgiproxy2.readthedocs.org/en/latest/
MIT License
12 stars 17 forks source link

OPTIONS method is not allowed #15

Closed reteptilian closed 7 years ago

reteptilian commented 7 years ago

As hardcoded in proxies.py, OPTIONS is not one of the ALLOWED_METHODS.

This prevents me from fully testing my app via webtest (which uses wsgiproxy in one of its test modes).

Is there anything preventing you from adding it?

gawel commented 7 years ago

It's really easy to override:

TestApp(HostProxy(uri, 'requests', allowed_metods))

But I have no objections if you want to add this verb

reteptilian commented 7 years ago

Ah, thanks, I didn't know about that.

I use webtest's WEBTEST_TARGET_URL feature since I run my test suite in both modes ... both in process and also via external calls via WEBTEST_TARGET_URL and HostProxy. Unfortunately, webtest's WEBTEST_TARGET_URL logic doesn't give you the ability to customize HostProxy.

But it's nice to know I could pass in my own HostProxy. I'd just have to modify all the places where I create TestApps ... it's enough of a pain that for now I think I will stick with using a forked version of WSGIProxy2 with OPTIONS added to the allowed methods.

gawel commented 7 years ago

Again, feel free to make a PR to add the verb if it make things easier for you.