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

Trailing / in backend ProxyTo URL causes routing error #564

Open
willmostly opened this issue Dec 4, 2024 · 1 comment · May be fixed by #570
Open

Trailing / in backend ProxyTo URL causes routing error #564

willmostly opened this issue Dec 4, 2024 · 1 comment · May be fixed by #570
Labels
good first issue Good for newcomers

Comments

@willmostly
Copy link
Contributor

willmostly commented Dec 4, 2024

A trailing slash in the proxyTo URL, e.g.

{"name": "my-proxy-target", "routingGroup":"adhoc", "ProxyTo": "https://my-proxy-target.io/", "ExternalUrl": "https://my-proxy-target.io/"}

will produce a URL like https://my-proxy-target.io//v1/statement. Double slashes in the path are illegal, and will produce an obscure error message such as

org.eclipse.jetty.http.BadMessageException: 400: Ambiguous URI empty segment at 
org.eclipse.jetty.server.internal.HttpConnection$HttpStreamOverHTTP1.headerComplete(HttpConnection.java:1194) at 
org.eclipse.jetty.server.internal.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:959) at 
org.eclipse.jetty.http.HttpParser.parseFields(HttpParser.java:1350) at 
org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:1646) at 
org.eclipse.jetty.server.internal.HttpConnection.parseRequestBuffer(HttpConnection.java:575) at 
org.eclipse.jetty.server.internal.HttpConnection.onFillable(HttpConnection.java:382) at 
org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:322) at 
org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:99) at 
org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53) at 
org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:478) at 
org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:441) at 
org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:293) at 
org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.run(AdaptiveExecutionStrategy.java:201) at 
org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:311) at 
org.eclipse.jetty.util.thread.MonitoredQueuedThreadPool$1.run(MonitoredQueuedThreadPool.java:73) at 
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:979) at 
org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1209) at 
org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1164) at 
java.base/java.lang.Thread.run(Thread.java:1575)
@willmostly willmostly added the good first issue Good for newcomers label Dec 4, 2024
@neshatadyen
Copy link

Thank you for sharing it! We're experimenting Trino Gateway and it would be difficult to find the issue for us if you haven't shared this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
2 participants