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

LibWeb: Move extract_mime_type() from XMLHttpRequest to HeaderList

Except some minor tweaks, this is a direct copy of Luke's initial
implementation in XMLHttpRequest, now replacing the former.
This commit is contained in:
Linus Groh 2022-07-20 17:47:29 +01:00
parent dfd62437c4
commit 042dfc7284
4 changed files with 63 additions and 60 deletions

View file

@ -13,6 +13,7 @@
#include <AK/Optional.h>
#include <AK/String.h>
#include <AK/Vector.h>
#include <LibWeb/MimeSniff/MimeType.h>
namespace Web::Fetch::Infrastructure {
@ -38,6 +39,7 @@ public:
[[nodiscard]] ErrorOr<void> set(Header);
[[nodiscard]] ErrorOr<void> combine(Header);
[[nodiscard]] ErrorOr<Vector<Header>> sort_and_combine() const;
[[nodiscard]] Optional<MimeSniff::MimeType> extract_mime_type() const;
};
[[nodiscard]] ErrorOr<OrderedHashTable<ByteBuffer>> convert_header_names_to_a_sorted_lowercase_set(Span<ReadonlyBytes>);