Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-2422

Response Status Line protocol is hard-coded to "HTTP/1.1"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.3.18.Final, 2.2.37.Final
    • 2.3.14.Final
    • Core
    • None

      My 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.

              flaviarnn Flavia Rainone
              jeff_okamoto Jeff Okamoto (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: