|
@@ -7234,14 +7234,6 @@ Server::process_request(Stream &strm, const std::string &remote_addr,
|
|
|
#endif
|
|
#endif
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
- // Check if the request URI doesn't exceed the limit
|
|
|
|
|
- if (line_reader.size() > CPPHTTPLIB_REQUEST_URI_MAX_LENGTH) {
|
|
|
|
|
- Headers dummy;
|
|
|
|
|
- detail::read_headers(strm, dummy);
|
|
|
|
|
- res.status = StatusCode::UriTooLong_414;
|
|
|
|
|
- return write_response(strm, close_connection, req, res);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
// Request line and headers
|
|
// Request line and headers
|
|
|
if (!parse_request_line(line_reader.ptr(), req) ||
|
|
if (!parse_request_line(line_reader.ptr(), req) ||
|
|
|
!detail::read_headers(strm, req.headers)) {
|
|
!detail::read_headers(strm, req.headers)) {
|
|
@@ -7249,6 +7241,14 @@ Server::process_request(Stream &strm, const std::string &remote_addr,
|
|
|
return write_response(strm, close_connection, req, res);
|
|
return write_response(strm, close_connection, req, res);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // Check if the request URI doesn't exceed the limit
|
|
|
|
|
+ if (req.target.size() > CPPHTTPLIB_REQUEST_URI_MAX_LENGTH) {
|
|
|
|
|
+ Headers dummy;
|
|
|
|
|
+ detail::read_headers(strm, dummy);
|
|
|
|
|
+ res.status = StatusCode::UriTooLong_414;
|
|
|
|
|
+ return write_response(strm, close_connection, req, res);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (req.get_header_value("Connection") == "close") {
|
|
if (req.get_header_value("Connection") == "close") {
|
|
|
connection_closed = true;
|
|
connection_closed = true;
|
|
|
}
|
|
}
|