diff options
author | Tim Schumacher <timschumi@gmx.de> | 2023-02-08 21:08:01 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-02-13 00:50:07 +0000 |
commit | d43a7eae545cd699f301471bd0f82399174339c1 (patch) | |
tree | c0a55f768f845041c3aebed3f126d462155a799f /Userland/Services/WebServer/Client.cpp | |
parent | 14951b92ca6160664ccb68c5e1b2d40133763e5f (diff) | |
download | serenity-d43a7eae545cd699f301471bd0f82399174339c1.zip |
LibCore: Rename `File` to `DeprecatedFile`
As usual, this removes many unused includes and moves used includes
further down the chain.
Diffstat (limited to 'Userland/Services/WebServer/Client.cpp')
-rw-r--r-- | Userland/Services/WebServer/Client.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Userland/Services/WebServer/Client.cpp b/Userland/Services/WebServer/Client.cpp index beb497438b..5e06d22338 100644 --- a/Userland/Services/WebServer/Client.cpp +++ b/Userland/Services/WebServer/Client.cpp @@ -14,8 +14,8 @@ #include <AK/StringBuilder.h> #include <AK/URL.h> #include <LibCore/DateTime.h> +#include <LibCore/DeprecatedFile.h> #include <LibCore/DirIterator.h> -#include <LibCore/File.h> #include <LibCore/MappedFile.h> #include <LibCore/MimeData.h> #include <LibHTTP/HttpRequest.h> @@ -132,7 +132,7 @@ ErrorOr<bool> Client::handle_request(ReadonlyBytes raw_request) path_builder.append(requested_path); auto real_path = TRY(path_builder.to_string()); - if (Core::File::is_directory(real_path.bytes_as_string_view())) { + if (Core::DeprecatedFile::is_directory(real_path.bytes_as_string_view())) { if (!resource_decoded.ends_with('/')) { StringBuilder red; @@ -147,14 +147,14 @@ ErrorOr<bool> Client::handle_request(ReadonlyBytes raw_request) index_html_path_builder.append(real_path); index_html_path_builder.append("/index.html"sv); auto index_html_path = TRY(index_html_path_builder.to_string()); - if (!Core::File::exists(index_html_path)) { + if (!Core::DeprecatedFile::exists(index_html_path)) { TRY(handle_directory_listing(requested_path, real_path, request)); return true; } real_path = index_html_path; } - auto file = Core::File::construct(real_path.bytes_as_string_view()); + auto file = Core::DeprecatedFile::construct(real_path.bytes_as_string_view()); if (!file->open(Core::OpenMode::ReadOnly)) { TRY(send_error_response(404, request)); return false; @@ -169,7 +169,7 @@ ErrorOr<bool> Client::handle_request(ReadonlyBytes raw_request) auto const info = ContentInfo { .type = TRY(String::from_deprecated_string(Core::guess_mime_type_based_on_filename(real_path.bytes_as_string_view()))), - .length = TRY(Core::File::size(real_path.bytes_as_string_view())) + .length = TRY(Core::DeprecatedFile::size(real_path.bytes_as_string_view())) }; TRY(send_response(*stream, request, move(info))); return true; |