diff --git a/src/server/api/url_parser.cpp b/src/server/api/url_parser.cpp index d217a3bcc..19f1574c6 100644 --- a/src/server/api/url_parser.cpp +++ b/src/server/api/url_parser.cpp @@ -56,8 +56,11 @@ boost::optional parseURL(std::string::iterator &iter, const std::stri return boost::make_optional(out); } } - catch (const x3::expectation_failure &) + catch (const x3::expectation_failure &failure) { + // The grammar above using expectation parsers ">" does not automatically increment the + // iterator to the failing position. Extract the position from the exception ourselves. + iter = failure.where(); } return boost::none;