Can not set HTTP status message in response anymore comparing 10.6 to 12.3
Hi list,
I just started to update my error reporting library [1] to 12 and XQuery 4.0.
This used HTTP messages in previous versions to report the exact kind of problem the server encountert. It relies on this snippet working: declare
%rest:path("response_message")
function api:response_message() {
(web:response-header(
{},
{ 'Cache-Control': 'max-age=3600,public' },
{ 'status': 200, 'message': '*Something else*' }
), "Something else")
};
To my surprise this does not show "Something else" as the HTTP status message.
curl -i http://localhost:8984/response_message HTTP/1.1 200 *OK* Server: Jetty(12.1.8) Date: Fri, 17 Apr 2026 15:45:09 GMT Cache-Control: max-age=3600,public Content-Type: application/xml; charset=UTF-8 Server-Timing: parse;dur=5.49 ms,compile;dur=0.68 ms,optimize;dur=0.01 ms,evaluate;dur=0.00 ms,serialize;dur=0.00 ms Content-Length: 14
Something else
As setting the HTTP status message to anything is a rather obscure feature, I would say updating the docs and stating, that this no longer works would "solve" this error. The last version I tested this with and it worked is 10.6 (probably any version running in Jetty 9.4).
BaseX 12.3 [HTTP Server] [main] INFO org.eclipse.jetty.server.Server - jetty-12.1.8; built: 2026-04-01T01:09:18.991Z; git: c9cdc9aaa434a3665b8a53b4d1cc3684992da649; jvm 17.0.18+8-LTS [main] INFO org.eclipse.jetty.ee9.webapp.StandardDescriptorProcessor - NO JSP Support for /, did not find org.eclipse.jetty.ee9.jsp.JettyJspServlet [main] INFO org.eclipse.jetty.session.DefaultSessionIdManager - Session workerName=node0 Server was started (port: 1984). [main] INFO org.eclipse.jetty.server.handler.ContextHandler - Started oeje9n.ContextHandler$CoreContextHandler@3543df7d{BaseX: The XML Database and XQuery Processor,/,b=file:///V:/basexapiproblem/webapp/,a=AVAILABLE,h=oeje9n.ContextHandler$CoreContextHandler$CoreToNestedHandler@7c541c15{STARTED}} [main] INFO org.eclipse.jetty.server.AbstractConnector - Started oejs.ServerConnector@7af30760{HTTP/1.1, (http/1.1)}{0.0.0.0:8984} [main] INFO org.eclipse.jetty.server.Server - Started oejs.Server@758c83d8{STARTING}[12.1.8,sto=0] @435ms HTTP STOP Server was started (port: 8081). HTTP Server was started (port: 8984).
Best regards
Hi Omar,
Thanks for the observation. It seems that the HTTP message is now ignored by Jetty (presumably version 12?). It has been marked as deprecated for some time [1], which is why we it will now be removed it from BaseX as well [2].
If you want to send a custom message, the official recommendation is to send it in the body of the response.
Hope this helps, Christian
[1] https://jakarta.ee/specifications/platform/9/apidocs/jakarta/servlet/http/httpservletresponse#setStatus-int-java.lang.String- [2] https://docs.basex.org/13/Web_Functions#web:response-header
Quoted text · Omar Siam · 64 lines
Von: Omar Siam via BaseX-Talk <basex-talk at mailman.uni-konstanz.de> Gesendet: Freitag, 17. April 2026 18:07 An: BaseX Betreff: [basex-talk] Can not set HTTP status message in response anymore comparing 10.6 to 12.3 Hi list, I just started to update my error reporting library [1] to 12 and XQuery 4.0. This used HTTP messages in previous versions to report the exact kind of problem the server encountert. It relies on this snippet working: declare %rest:path("response_message") function api:response_message() { (web:response-header( {}, { 'Cache-Control': 'max-age=3600,public' }, { 'status': 200, 'message': '*Something else*' } ), "Something else") }; To my surprise this does not show "Something else" as the HTTP status message. curl -i http://localhost:8984/response_message HTTP/1.1 200 *OK* Server: Jetty(12.1.8) Date: Fri, 17 Apr 2026 15:45:09 GMT Cache-Control: max-age=3600,public Content-Type: application/xml; charset=UTF-8 Server-Timing: parse;dur=5.49 ms,compile;dur=0.68 ms,optimize;dur=0.01 ms,evaluate;dur=0.00 ms,serialize;dur=0.00 ms Content-Length: 14 Something else As setting the HTTP status message to anything is a rather obscure feature, I would say updating the docs and stating, that this no longer works would "solve" this error. The last version I tested this with and it worked is 10.6 (probably any version running in Jetty 9.4). BaseX 12.3 [HTTP Server] [main] INFO org.eclipse.jetty.server.Server - jetty-12.1.8; built: 2026-04-01T01:09:18.991Z; git: c9cdc9aaa434a3665b8a53b4d1cc3684992da649; jvm 17.0.18+8-LTS [main] INFO org.eclipse.jetty.ee9.webapp.StandardDescriptorProcessor - NO JSP Support for /, did not find org.eclipse.jetty.ee9.jsp.JettyJspServlet [main] INFO org.eclipse.jetty.session.DefaultSessionIdManager - Session workerName=node0 Server was started (port: 1984). [main] INFO org.eclipse.jetty.server.handler.ContextHandler - Started oeje9n.ContextHandler$CoreContextHandler@3543df7d{BaseX: The XML Database and XQuery Processor,/,b=file:///V:/basexapiproblem/webapp/,a=AVAILABLE,h=oeje9n.ContextHandler$CoreContextHandler$CoreToNestedHandler@7c541c15{STARTED}} [main] INFO org.eclipse.jetty.server.AbstractConnector - Started oejs.ServerConnector@7af30760{HTTP/1.1, (http/1.1)}{0.0.0.0:8984} [main] INFO org.eclipse.jetty.server.Server - Started oejs.Server@758c83d8{STARTING}[12.1.8,sto=0] @435ms HTTP STOP Server was started (port: 8081). HTTP Server was started (port: 8984). Best regards [1] https://github.com/acdh-oeaw/api-problem4restxq -- Mag. Ing. Omar Siam Austrian Center for Digital Humanities Österreichische Akademie der Wissenschaften | Austrian Academy of Sciences Stellvertretende Behindertenvertrauensperson | Deputy representative for disabled persons Bäckerstraße 13, 1010 Wien, Österreich | Vienna, Austria T: +43 1 51581-7295 omar.siam at oeaw.ac.at | www.oeaw.ac.at/acdh
Written for BaseX 12.3. BaseX may have changed since: please check the current documentation.