Fix wsgi invalid request uri#4551
Conversation
99e5faf to
a1ca22a
Compare
|
Hi @emdneto, seems that these changes are now breaking some Falcon tests. Should I do something like |
I would fix the Falcon tests instead, since the target is no longer used to parse the path and query. Because of that, Also, please fix precommit by running |
|
Thanks for the PR! Just a heads-up: we no longer update Please add the appropriate changelog fragment for this change instead of editing |
48f6b40 to
6f6c160
Compare
tammy-baylis-swi
left a comment
There was a problem hiding this comment.
Lgtm and adheres to PEP 333.
Add PATH_INFO to the environment for CONNECT request.
Co-authored-by: Riccardo Magliocchetti <[email protected]>
Description
Fixes #4447
WSGI Instrumentation currently parses
RAW_URI/REQUEST_URIto deriveurl.path&url.query.Malformed request URIs can causeurllib.parse.urlparseto raise aValueError, which breaks instrumentation and may result in a 500 response.This change avoids parsing the raw request URI and instead derives
url.pathandurl.querydirectly from the WSGI environ (PATH_INFO and QUERY_STRING).Type of change
How Has This Been Tested?
Ran tests:
uv run python -m pytest instrumentation/opentelemetry-instrumentation-wsgi/tests
All tests pass.
Does This PR Require a Core Repo Change?
Checklist: