Fixed handling invalid http requests.
This commit is contained in:
parent
d566fccb1e
commit
29517e9a24
1 changed files with 4 additions and 1 deletions
|
|
@ -29,7 +29,10 @@ public class HttpServerConnection extends Thread {
|
|||
|
||||
private static boolean readRequestHeader(InputStream in, HttpRequest request) throws IOException {
|
||||
BufferedReader r = new BufferedReader(new InputStreamReader(in));
|
||||
Matcher m = requestHeaderLine.matcher(r.readLine());
|
||||
String statusLine = r.readLine();
|
||||
if (statusLine == null)
|
||||
return false;
|
||||
Matcher m = requestHeaderLine.matcher(statusLine);
|
||||
if (!m.matches())
|
||||
return false;
|
||||
request.method = m.group(1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue