Skip to content

Fix uncaught exception in http_server_asio.cpp for invalid URL path #634

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Release/src/http/listener/http_server_asio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ will_deref_and_erase_t asio_server_connection::handle_http_line(const boost::sys
{
m_request.set_request_uri(utility::conversions::to_string_t(http_path_and_version.substr(1, http_path_and_version.size() - VersionPortionSize - 1)));
}
catch(const web::uri_exception &e)
catch (const std::exception& e) // may be std::range_error indicating invalid Unicode, or web::uri_exception
{
m_request.reply(status_codes::BadRequest, e.what());
m_close = true;
Expand Down Expand Up @@ -913,7 +913,7 @@ will_deref_and_erase_t asio_server_connection::dispatch_request_to_listener()
{
pListener = m_p_parent->find_listener(m_request.relative_uri());
}
catch (const web::uri_exception&)
catch (const std::exception&) // may be web::uri_exception, or std::range_error indicating invalid Unicode
{
m_request.reply(status_codes::BadRequest);
(will_erase_from_parent_t)do_response();
Expand Down