-
Notifications
You must be signed in to change notification settings - Fork 80
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
base: main
Are you sure you want to change the base?
Conversation
gateway-ha/src/main/java/io/trino/gateway/ha/router/HaGatewayManager.java
Outdated
Show resolved
Hide resolved
gateway-ha/src/test/java/io/trino/gateway/ha/router/TestHaGatewayManager.java
Show resolved
Hide resolved
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.
Looks good % @ebyhr's comment
gateway-ha/src/main/java/io/trino/gateway/ha/router/HaGatewayManager.java
Outdated
Show resolved
Hide resolved
@willmostly @ebyhr can you please review. |
gateway-ha/src/main/java/io/trino/gateway/ha/router/HaGatewayManager.java
Outdated
Show resolved
Hide resolved
Please squash commits into one. |
edffc7d
to
ea5058d
Compare
@ebyhr can you check now please? |
Please remove the commit body. |
ea5058d
to
e0a6092
Compare
@@ -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()); |
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.
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
.
Line 132 in 40337f6
String loginUrl = backend.getProxyTo() + UI_LOGIN_PATH; |
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.
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.
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: