LibWeb: Extract some CORS and MIME Fetch helpers to their own files

An upcoming commit will migrate the contents of Headers.h/cpp to LibHTTP
for use outside of LibWeb. These CORS and MIME helpers depend on other
LibWeb facilities, however, so they cannot be moved.
This commit is contained in:
Timothy Flynn 2025-11-26 13:32:39 -05:00 committed by Jelle Raaijmakers
parent 0fd80a8f99
commit 3dce6766a3
Notes: github-actions[bot] 2025-11-27 13:58:58 +00:00
30 changed files with 382 additions and 299 deletions

View file

@ -12,6 +12,7 @@
#include <LibTextCodec/Decoder.h>
#include <LibWeb/DOM/Attr.h>
#include <LibWeb/DOM/Document.h>
#include <LibWeb/Fetch/Infrastructure/HTTP/MIME.h>
#include <LibWeb/HTML/Parser/HTMLEncodingDetection.h>
#include <LibWeb/Infra/CharacterTypes.h>
@ -444,7 +445,7 @@ Optional<ByteString> run_bom_sniff(ReadonlyBytes input)
// Byte order mark Encoding
// 0xEF 0xBB 0xBF UTF-8
// 0xFE 0xFF UTF-16BE
// 0xFF 0xFE UTF-16LE
// 0xFF 0xFE UTF-16LE
if (input[0] == 0xEF && input[1] == 0xBB && input[2] == 0xBF) {
return "UTF-8";
}