This repository was archived by the owner on Apr 4, 2023. It is now read-only.
Fix an incorrect pathname in a WebView endpoint URL #940
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.
Signed-off-by: Artem Zatsarynnyi [email protected]
What does this PR do?
It fixes an incorrect pathname in a WebView endpoint URL.
When Theia/WebView Che endpoint URL contains pathname,
e.g.
https://192.168.99.237.nip.io/server9u2gtltn-jwtproxy/webviews
Che Theia forms an incorrect URL for fetching WebView content,
like
https://192.168.99.237.nip.io/server9u2gtltn-jwtproxy/server-4402/webview/
.The last one is actually an URL for Theia endpoint but not for WebView endpoint.
It works well as both URLs are forward to the same internal container and port, but it may cause problems in the future.
The problem comes from the upstream
WebviewEnvironment
that usesEndpoint
for constructing an endpoint URL.Endpoint class relies on
self.location
browser API to get the pathname. That works incorrectly for Che when a WebView endpoint has a different hostname+pathname.That's why I've overrided
externalEndpointUrl
function in this PR to get WebView Che endpoint URL as is and not form it with help ofEndpoint
class.Screenshot/screencast of this PR
What issues does this PR fix or reference?
It's an additional patch for eclipse-che/che#17694
How to test this PR?
chectl server:deploy --platform=minikube --installer=operator --che-operator-cr-patch-yaml=patch.yaml
where
patch.yaml
content iswebviews
Che endpoint, but not through thetheia
Che endpoint. Also, make sure that the Welcome page is rendered and works correctly, e.g. the links are working.PR Checklist
As the author of this Pull Request I made sure that:
What issues does this PR fix or reference
andHow to test this PR
completedReviewers
Reviewers, please comment how you tested the PR when approving it.
Happy Path Channel
HAPPY_PATH_CHANNEL=stable