Skip to content

Commit

Permalink
fix: update no_scheme to exit properly
Browse files Browse the repository at this point in the history
  • Loading branch information
anonrig committed Feb 22, 2023
1 parent a07d0e4 commit 23cc12c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 23cc12c

Please sign in to comment.