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
@@ -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 = backend.getProxyTo().replaceAll("/$", "");
Copy link
Member

Choose a reason for hiding this comment

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

Please add a helper method to remove trailing slash.

Copy link
Member Author

@prakhar10 prakhar10 Dec 14, 2024

Choose a reason for hiding this comment

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

Should I add the helper method in the same class @ebyhr ?

@@ -82,5 +82,16 @@ void testGatewayManager()
assertThat(haGatewayManager.getAllBackends())
.extracting(ProxyBackendConfiguration::getRoutingGroup)
.containsExactly("adhoc");

ProxyBackendConfiguration etl = new ProxyBackendConfiguration();
Copy link
Member

Choose a reason for hiding this comment

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

Please extract a test method.

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
2 participants