diff --git a/src/parser.cpp b/src/parser.cpp index fde7f2d1f..2f6f2faaf 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -126,7 +126,8 @@ namespace ada::parser { case ada::state::NO_SCHEME: { ada_log("NO_SCHEME ", helpers::substring(url_data, input_position)); // If base is null, or base has an opaque path and c is not U+0023 (#), validation error, return failure. - if (base_url == nullptr || (base_url->has_opaque_path && (input_position != input_size))) { + // SCHEME state updates the state to NO_SCHEME and validates url_data is not empty. + if (base_url == nullptr || (base_url->has_opaque_path && url_data[input_position] != '#')) { ada_log("NO_SCHEME validation error"); url.is_valid = false; return url;