Dear Jan,

Thanks for the bug report. We have replaced the unexpected error with a 
controlled error message [1].

> Is the web:forwardfunction actually supposed to also work with absolute URLs, 
> or only with relative URLs within the server?

With web:forward, server-side endpoints can be addressed, but no external URIs 
that are out of our control. To make that happen, you will need to use 
web:redirect. It is almost always the better choice: we even think about 
getting rid of web:forward, now that multiple server-side operations can be 
represented with multiple job:execute calls.

Hope this helps,
Christian

[1] https://files.basex.org/releases/latest/
________________________________________

Von: Jan Ctibor via BaseX-Talk <[email protected]>
Gesendet: Sonntag, 28. Juni 2026 21:32
An: [email protected]
Betreff: [basex-talk] web:forward with absolute URL

Hello, BaseX team,
I have found recently, that the web:forward function (in both BaseX 12.1 and 
12.4, have not checked with older versions), when called with an absolute URL, 
triggers an error in jetty (see below).

Best regards,
Jan Ctibor

P. S.
Is the web:forwardfunction actually supposed to also work with absolute URLs, 
or only with relative URLs within the server?


Improper use? Potential bug? Your feedback is welcome:
Contact: [email protected]
Version: BaseX 12.4
Java: Red Hat, Inc., 25.0.3
OS: Linux, amd64
Stack Trace:
org.eclipse.jetty.http.BadMessageException: 400: Ambiguous URI empty segment
       at org.eclipse.jetty.ee9.nested.Dispatcher.forward(Dispatcher.java:186)
       at org.eclipse.jetty.ee9.nested.Dispatcher.forward(Dispatcher.java:145)
       at org.basex.http.HTTPConnection.forward(HTTPConnection.java:260)
       at org.basex.http.restxq.RestXqResponse.finish(RestXqResponse.java:155)
       at org.basex.http.web.WebResponse.create(WebResponse.java:63)
       at org.basex.http.restxq.RestXqServlet.run(RestXqServlet.java:70)
       at org.basex.http.BaseXServlet.service(BaseXServlet.java:68)
       at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:587)
       at 
org.eclipse.jetty.ee9.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1415)
       at 
org.eclipse.jetty.ee9.servlet.ServletHolder.handle(ServletHolder.java:783)
       at 
org.eclipse.jetty.ee9.servlet.ServletHandler.doHandle(ServletHandler.java:528)
       at 
org.eclipse.jetty.ee9.nested.ScopedHandler.handle(ScopedHandler.java:125)
       at 
org.eclipse.jetty.ee9.security.SecurityHandler.handle(SecurityHandler.java:603)
       at 
org.eclipse.jetty.ee9.nested.HandlerWrapper.handle(HandlerWrapper.java:124)
       at 
org.eclipse.jetty.ee9.nested.ScopedHandler.nextHandle(ScopedHandler.java:195)
       at 
org.eclipse.jetty.ee9.nested.SessionHandler.doHandle(SessionHandler.java:612)
       at 
org.eclipse.jetty.ee9.nested.ScopedHandler.nextHandle(ScopedHandler.java:193)
       at 
org.eclipse.jetty.ee9.nested.ContextHandler.doHandle(ContextHandler.java:1047)
       at 
org.eclipse.jetty.ee9.nested.ScopedHandler.nextScope(ScopedHandler.java:162)
       at 
org.eclipse.jetty.ee9.servlet.ServletHandler.doScope(ServletHandler.java:483)
       at 
org.eclipse.jetty.ee9.nested.ScopedHandler.nextScope(ScopedHandler.java:160)
       at 
org.eclipse.jetty.ee9.nested.SessionHandler.doScope(SessionHandler.java:589)
       at 
org.eclipse.jetty.ee9.nested.ScopedHandler.nextScope(ScopedHandler.java:160)
       at 
org.eclipse.jetty.ee9.nested.ContextHandler.doScope(ContextHandler.java:962)
       at 
org.eclipse.jetty.ee9.nested.ScopedHandler.handle(ScopedHandler.java:123)
       at 
org.eclipse.jetty.ee9.nested.ContextHandler.handle(ContextHandler.java:1731)
       at 
org.eclipse.jetty.ee9.nested.HttpChannel$RequestDispatchable.dispatch(HttpChannel.java:1586)
       at 
org.eclipse.jetty.ee9.nested.HttpChannel.dispatch(HttpChannel.java:737)
       at org.eclipse.jetty.ee9.nested.HttpChannel.handle(HttpChannel.java:520)
       at 
org.eclipse.jetty.ee9.nested.ContextHandler$CoreContextHandler$CoreToNestedHandler.handle(ContextHandler.java:3059)
       at 
org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1226)
       at org.eclipse.jetty.server.Server.handle(Server.java:197)
       at 
org.eclipse.jetty.server.internal.HttpChannelState$HandlerInvoker.run(HttpChannelState.java:788)
       at 
org.eclipse.jetty.server.internal.HttpConnection.onFillable(HttpConnection.java:420)
       at 
org.eclipse.jetty.server.internal.HttpConnection$FillableCallback.succeeded(HttpConnection.java:1809)
       at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
       at 
org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:54)
       at 
org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:492)
       at 
org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.epcRunTask(AdaptiveExecutionStrategy.java:428)
       at 
org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:401)
       at 
org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:255)
       at 
org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.run(AdaptiveExecutionStrategy.java:204)
       at 
org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:317)
       at 
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:1009)
       at 
org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1240)
       at 
org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1194)
       at java.base/java.lang.Thread.run(Thread.java:1474)



Reply via email to