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.
This has been reported to happen on WEBrick, it may happen in other ways depending on how the variable is set.
What does this PR do?
Handle #2310 differently, preventing an exception for invalid URLs as found in #2309
Motivation
#2310 causes #2309 again because of the introduction of URI parsing via
URI.join
at a stage to early.Additional Notes
How to test the change?
Start an app like so (with tracing enabled of course):
Then
curl
it:On Puma this should return a
HTTP/1.1 404 Not Found
and in therack.request
span tags the path should be replaced by a?
placeholder by quantization:On WEBrick, which attempts to parse the URI by itself, this should return an early
HTTP/1.1 400 Bad Request
:Unfortunately I could not introduce proper non-regression spec examples like this:
Indeed
Rack::Test
tries to parse the route very early when itsget
is called, therefore triggers the exception way before anything happens:So, short of hacking
Rack::Test
to death I skipped adding these.