Skip to content

Commit e850595

Browse files
committed
Fixing issue with Windows http_listener where an invalid URI on a request could bring the server down.
1 parent f48c41a commit e850595

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Release/src/http/listener/http_server_httpsys.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,14 @@ void windows_request_context::read_headers_io_completion(DWORD error_code, DWORD
540540
{
541541
builder.set_query(uri::decode(builder.query()));
542542
}
543-
m_msg.set_request_uri(builder.to_uri());
543+
try
544+
{
545+
m_msg.set_request_uri(builder.to_uri());
546+
}
547+
catch(const uri_exception &e)
548+
{
549+
m_msg.reply(status_codes::InternalError, e.what());
550+
}
544551
m_msg.set_method(parse_request_method(m_request));
545552
parse_http_headers(m_request->Headers, m_msg.headers());
546553

0 commit comments

Comments
 (0)