Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove trailing slash in proxyTo and externalUrl in create and update backend methods #570

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

prakhar10
Copy link
Member

Description

Remove trailing slash in proxyTo and externalUrl in create and update backend methods. Fixes #564

Additional context and related issues

Release notes

( ) This is not user-visible or is docs only, and no release notes are required.
(X) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text:

@cla-bot cla-bot bot added the cla-signed label Dec 13, 2024
Copy link
Contributor

@willmostly willmostly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good % @ebyhr's comment

@prakhar10
Copy link
Member Author

@willmostly @ebyhr can you please review.

@ebyhr
Copy link
Member

ebyhr commented Jan 20, 2025

Please squash commits into one.

@prakhar10 prakhar10 force-pushed the trailing-slash-issue branch from edffc7d to ea5058d Compare January 20, 2025 14:53
@prakhar10
Copy link
Member Author

@ebyhr can you check now please?

@ebyhr
Copy link
Member

ebyhr commented Jan 20, 2025

Revert handling multiple trailing slashes in url

Please remove the commit body.

@prakhar10 prakhar10 force-pushed the trailing-slash-issue branch from ea5058d to e0a6092 Compare January 21, 2025 03:47
@@ -94,19 +94,23 @@ public void activateBackend(String backendName)
@Override
public ProxyBackendConfiguration addBackend(ProxyBackendConfiguration backend)
{
dao.create(backend.getName(), backend.getRoutingGroup(), backend.getProxyTo(), backend.getExternalUrl(), backend.isActive());
String backendProxyTo = removeTrailingSlash(backend.getProxyTo());
String backendExternalUrl = removeTrailingSlash(backend.getExternalUrl());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These getters are called from other places. Please check all usages. For instance, The following place has the same issue because UI_LOGIN_PATH is /ui/login.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the way I was thinking about this is to remove the slash while saving a new backend or updating a new backend so that later on any method that pulls this will always get the correct url from the database instead of trimming it in every part of the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Trailing / in backend ProxyTo URL causes routing error
3 participants