LibURL: Implement create_with_file_scheme using URL Parser

Creating a URL should almost always go through the URLParser to
handle all of the small edge cases involved. This reduces the
need for URL valid state.
This commit is contained in:
Shannon Booth 2025-04-19 16:41:19 +12:00 committed by Tim Flynn
commit 2072eee83d
Notes: github-actions[bot] 2025-04-19 11:20:23 +00:00
4 changed files with 17 additions and 13 deletions

View file

@ -435,7 +435,7 @@ static void do_run_tests(XML::Document& document)
path_builder.append(suite.attributes.find("URI")->value);
auto url = URL::create_with_file_scheme(path_builder.string_view());
auto file_path = URL::percent_decode(url.serialize_path());
auto file_path = URL::percent_decode(url->serialize_path());
auto file_result = Core::File::open(file_path, Core::File::OpenMode::Read);
if (file_result.is_error()) {
warnln("Read error for {}: {}", file_path, file_result.error());