Fix wsgi invalid request uri#4551
Open
IonDragos2003 wants to merge 6 commits intoopen-telemetry:mainfrom
Open
Conversation
emdneto
reviewed
May 8, 2026
99e5faf to
a1ca22a
Compare
Author
|
Hi @emdneto, seems that these changes are now breaking some Falcon tests. Should I do something like |
Member
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 |
emdneto
reviewed
May 8, 2026
| } | ||
| expected_new = { | ||
| URL_PATH: "/3/library/urllib.parse.html", | ||
| URL_QUERY: "highlight=params", |
Member
There was a problem hiding this comment.
What was the issue with the URL_QUERY here? Can we update the test to still reflect that?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: