mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-28 13:18:19 +00:00
LibURL+LibWeb: Remove leading slash when converting url to path
...on Windows
This commit is contained in:
parent
5ff32fb090
commit
32ddeb82d6
Notes:
github-actions[bot]
2025-04-11 01:05:22 +00:00
Author: https://github.com/stasoid
Commit: 32ddeb82d6
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3569
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/R-Goc
Reviewed-by: https://github.com/shannonbooth ✅
5 changed files with 18 additions and 5 deletions
|
@ -45,7 +45,7 @@ ErrorOr<String> load_error_page(URL::URL const& url, StringView error_message)
|
|||
ErrorOr<String> load_file_directory_page(URL::URL const& url)
|
||||
{
|
||||
// Generate HTML contents entries table
|
||||
auto lexical_path = LexicalPath(URL::percent_decode(url.serialize_path()));
|
||||
auto lexical_path = LexicalPath(url.file_path());
|
||||
Core::DirIterator dt(lexical_path.string(), Core::DirIterator::Flags::SkipParentAndBaseDir);
|
||||
Vector<ByteString> names;
|
||||
while (dt.has_next())
|
||||
|
|
|
@ -102,7 +102,7 @@ void Resource::did_load(Badge<ResourceLoader>, ReadonlyBytes data, HTTP::HeaderM
|
|||
if (content_type_options.value_or("").equals_ignoring_ascii_case("nosniff"sv)) {
|
||||
m_mime_type = "text/plain";
|
||||
} else {
|
||||
m_mime_type = Core::guess_mime_type_based_on_filename(URL::percent_decode(url().serialize_path()));
|
||||
m_mime_type = Core::guess_mime_type_based_on_filename(url().file_path());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -321,7 +321,7 @@ void ResourceLoader::load(LoadRequest& request, GC::Root<SuccessCallback> succes
|
|||
}
|
||||
|
||||
auto data = resource.value()->data();
|
||||
auto response_headers = response_headers_for_file(URL::percent_decode(url.serialize_path()), resource.value()->modified_time());
|
||||
auto response_headers = response_headers_for_file(url.file_path(), resource.value()->modified_time());
|
||||
|
||||
// FIXME: Implement timing info for resource requests.
|
||||
Requests::RequestTimingInfo fixme_implement_timing_info {};
|
||||
|
@ -339,7 +339,7 @@ void ResourceLoader::load(LoadRequest& request, GC::Root<SuccessCallback> succes
|
|||
return;
|
||||
}
|
||||
|
||||
FileRequest file_request(URL::percent_decode(url.serialize_path()), [this, success_callback, error_callback, request, respond_directory_page](ErrorOr<i32> file_or_error) {
|
||||
FileRequest file_request(url.file_path(), [this, success_callback, error_callback, request, respond_directory_page](ErrorOr<i32> file_or_error) {
|
||||
--m_pending_loads;
|
||||
if (on_load_counter_change)
|
||||
on_load_counter_change();
|
||||
|
@ -387,7 +387,7 @@ void ResourceLoader::load(LoadRequest& request, GC::Root<SuccessCallback> succes
|
|||
}
|
||||
|
||||
auto data = maybe_data.release_value();
|
||||
auto response_headers = response_headers_for_file(URL::percent_decode(request.url().serialize_path()), st_or_error.value().st_mtime);
|
||||
auto response_headers = response_headers_for_file(request.url().file_path(), st_or_error.value().st_mtime);
|
||||
|
||||
// FIXME: Implement timing info for file requests.
|
||||
Requests::RequestTimingInfo fixme_implement_timing_info {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue