Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-28284

(7.4.z) UNDERTOW-2422 - Response Status Line protocol is hard-coded to "HTTP/1.1"

XMLWordPrintable

      Sample code is:

      public class UndertowApp {
          public static void main(String[] args) {
              Undertow server = Undertow.builder()
                  .addHttpListener(8080, "0.0.0.0")
                      .setHandler(exchange -> {
                          exchange.setProtocol(new HttpString("HTTP/1.0"));
                          exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, "text/plain");
                          exchange.getResponseSender().send("Hello from Undertow!");
                      }).build();
      
              server.start();
              System.out.println("Server started on http://0.0.0.0:8080");
      
      }
      

      Despite setting the protocol to "HTTP/1.0", the status line says 'HTTP/1.1".

      I think it would be better if the protocol field from the HttpServerExchange were sent back to the client, not a hard-coded string.

              rhn-engineering-lgao Lin Gao
              rhn-engineering-lgao Lin Gao
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: