Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8287593

ShortResponseBody could be made more resilient to rogue connections

XMLWordPrintable

    • b05

        ShortResponseBody$ReplyingServer could simply ignore requests that don't target the expected URI (or reply with 500), instead of simply asserting:

        =======================================================

                            String query = uriPath.getRawQuery();
                            if (query == null) {
                                out.println("Request headers: [" + headers + "]");
        + continue;
                            }
                            assert query != null : "null query for uriPath: " + uriPath;

        =======================================================

        SSLVariableLengthServer: got connection PlainVariableLengthServer: got connection PRI *
        Request headers: [HTTP/2.0

        ]
        Unexpected exception in server: java.lang.AssertionError: null query for uriPath: *
        java.lang.AssertionError: null query for uriPath: *
        at ShortResponseBody$ReplyingServer.run(ShortResponseBody.java:507)

              rjernst Ryan Ernst
              dfuchs Daniel Fuchs
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: