1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:47:35 +00:00

WebServer: Remove a call to String::from_deprecated_string

guess_mime_type_based_on_filename() returns a StringView, so no
need to bring DeprecatedString's (implicit) ctor into this.

No behavior change.
This commit is contained in:
Nico Weber 2023-02-26 18:00:31 -05:00 committed by Tim Flynn
parent 8e5ebb04f4
commit a83f4ec186

View file

@ -169,7 +169,7 @@ ErrorOr<bool> Client::handle_request(ReadonlyBytes raw_request)
auto stream = TRY(Core::File::open(real_path.bytes_as_string_view(), Core::File::OpenMode::Read));
auto const info = ContentInfo {
.type = TRY(String::from_deprecated_string(Core::guess_mime_type_based_on_filename(real_path.bytes_as_string_view()))),
.type = TRY(String::from_utf8(Core::guess_mime_type_based_on_filename(real_path.bytes_as_string_view()))),
.length = TRY(Core::DeprecatedFile::size(real_path.bytes_as_string_view()))
};
TRY(send_response(*stream, request, move(info)));