Processing OPTIONS request with query parameters in URL
See original GitHub issue-
I’m submitting a … [*] bug report [ ] feature request [ ] question about the decisions made in the repository
-
Do you want to request a feature or report a bug? I want to report a bug.
-
What is the current behavior? I use CherryPy as WSGI server to serve my Flask application. When I send OPTIONS request with query parameters, for example http://0.0.0.0/profile?param=1, server returns 404 NOT FOUND. It occurs due to wrong URL processing, query string doesn’t remove from URL in request processing.
That’s behaviour appears after upgrading CherryPy from 11.0.0 to 12.0.0
- If the current behavior is a bug, please provide the steps to reproduce and if possible a screenshots and logs of the problem.
- CherryPy 12.0.0:
andrey@asus-K55N:~$ curl -i -X OPTIONS http://localhost:5000/api/profile/tariffs?monthly=1
HTTP/1.1 404 NOT FOUND
Content-Type: text/html
Content-Length: 233
Access-Control-Allow-Origin: *
Date: Mon, 20 Nov 2017 13:15:34 GMT
Server: 0.0.0.0
andrey@asus-K55N:~$ curl -i -X OPTIONS http://localhost:5000/api/profile/tariffs
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Allow: GET, OPTIONS, HEAD
Access-Control-Allow-Origin: *
Content-Length: 0
Date: Mon, 20 Nov 2017 13:15:37 GMT
Server: 0.0.0.0
- CherryPy 11.0.0:
andrey@asus-K55N:~$ curl -i -X OPTIONS http://localhost:5000/api/profile/tariffs?monthly=1
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Allow: HEAD, OPTIONS, GET
Access-Control-Allow-Origin: *
Content-Length: 0
Date: Mon, 20 Nov 2017 13:18:55 GMT
Server: 0.0.0.0
-
What is the expected behavior? Query string parameters should be cut off from URL, as it was in CherryPy 11.0.0.
-
What is the motivation / use case for changing the behavior? Properly processing of OPTIONS requests
-
Please tell us about your environment:
- Cheroot version: 5.9.1
- CherryPy version: 12.0.0
- Python version: 3.5.4
- OS: Kubuntu 16.04 LTS
- Browser: [all ]
Issue Analytics
- State:
- Created 6 years ago
- Comments:38 (24 by maintainers)
Top GitHub Comments
Here is a simple example showing my issue:
If you
curl "http://127.0.0.1:8080/test" -X GET
, you see “Did second get”. If youcurl "http://127.0.0.1:8080/test?key=value" -X GET
, you see “Did second get”. If youcurl "http://127.0.0.1:8080/test" -X OPTIONS
, you see “Did second options” If youcurl "http://127.0.0.1:8080/test?key=value" -X OPTIONS
, you get a 405 error (this is different than in versions before 11.1 where it prints “Did second options”.Hello. I’m trying to upgrade to cherrypy 18.1.0… Is the only viable workaround to use version 11?