< prev index next >

src/java.net.http/share/classes/jdk/internal/net/http/Http1HeaderParser.java

Print this page

        

@@ -192,19 +192,11 @@
             throw protocolException("Invalid status line: \"%s\"", statusLine);
         }
         if (statusLine.length() < 12) {
             throw protocolException("Invalid status line: \"%s\"", statusLine);
         }
-        try {
-            responseCode = Integer.parseInt(statusLine.substring(9, 12));
-        } catch (NumberFormatException nfe) {
-            throw protocolException("Invalid status line: \"%s\"", statusLine);
-        }
-        // response code expected to be a 3-digit integer (RFC-2616, section 6.1.1)
-        if (responseCode < 100) {
-            throw protocolException("Invalid status line: \"%s\"", statusLine);
-        }
+        responseCode = Integer.parseInt(statusLine.substring(9, 12));
 
         state = State.STATUS_LINE_END;
     }
 
     private void maybeStartHeaders(ByteBuffer input) {
< prev index next >