Skip to content

Commit

Permalink
HttpServer ignore requests with malformed request line (no method or …
Browse files Browse the repository at this point in the history
…URI)
  • Loading branch information
aslze committed Nov 11, 2024
1 parent 2cac658 commit 34fc204
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion include/asl/Mutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ A Lock is an automatic locker/unlocker of a Mutex. Locks the mutex on constructi
Mutex mutex;
void do_something_sync()
{
Lock lock(mutex);
Lock _(mutex);
do_something();
}
~~~
Expand Down
3 changes: 1 addition & 2 deletions include/asl/Xml.h
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,8 @@ class ASL_API Xml : public NodeBase

/**
Changes the tag name of this element
\deprecated Why would anyone do this?
*/
ASL_DEPRECATED(void setTag(const String& tag), "Seems unneeded")
void setTag(const String& tag)
{
_()->tag = tag;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Http.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ void HttpMessage::readBody()
while (!end)
{
int av = _socket->available();
if (av < 0 || !_socket->waitInput()) {
if (av < 0 || !_socket->waitInput(10)) {
break;
}
byte buffer[RECV_BLOCK_SIZE];
Expand Down
2 changes: 1 addition & 1 deletion src/HttpServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void HttpServer::serve(Socket client)
continue;

HttpRequest request(client);
if (client.error())
if (client.error() || !request.method().ok() || !request.path().ok() || !request.protocol().ok())
break;

String hconn = request.header("Connection").toLowerCase();
Expand Down

0 comments on commit 34fc204

Please sign in to comment.