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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How doe it fix the issue from the description? AFAIU the
urlPath
will be used as redirect location only for requests to/
on the server and that won't match/code
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the world of relative URLs and subpath proxying, we don't care if the traceviewer is accessible via
/code
/trace-viewer
or/base-url-of-companies-xy-test-tooling/playwright´. All queries hitting one of these proxy subpaths are forwarded to the proxy viewers
/` route.The traceViewer is none the wiser that it is exposed via a subpath.
However, this indirection is dependent on the fact that the server only returns relative URLs. This allows the browser to construct the new complete URL.
The problematic behavior now occurs only when there are nested proxies.
code
via/code/
./proxy/{{port}}
Without this change:
/code/proxy/8090
/code/proxy/8090
->/proxy/8090
3 App proxy strips part of the request
/proxy/8090
->/
/
and returns 302:/trace/{...}
/proxy/8090
+/trace/{...}
->/proxy/8090/trace/{...}
. The absolute nature of the request propagates./proxy/8090/trace/{...}
/proxy/8090/trace/{...}
/code
is missing.With this change:
/code/proxy/8090
/code/proxy/8090
->/
/
and returns 302:./trace/{...}
/
to/code/proxy/8090
./trace/{...}
coming from/code/proxy/8090
/code/proxy/8090
+./trace/{...}
=/code/proxy/8090/trace/{...}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the details explanation. I'm fine with the change, but reading you description of how it works with the app proxy today I get a feeling it will still not work:
Why with the relative url, it won't become
/proxy/8090 + ./trace/{...} -> /proxy/8090/trace/{...}
? Does the app proxy treat relative redirect location differently?