LibWeb/MimeSniff: Update Rar signature to match spec
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run

This commit is contained in:
Kemal Zebari 2025-07-30 22:51:02 -07:00 committed by Jelle Raaijmakers
commit 4e4026c89a
Notes: github-actions[bot] 2025-07-31 14:22:38 +00:00
2 changed files with 3 additions and 3 deletions

View file

@ -498,8 +498,8 @@ Optional<MimeType> match_an_archive_type_pattern(ReadonlyBytes input)
// The string "PK" followed by ETX EOT, the ZIP archive signature. // The string "PK" followed by ETX EOT, the ZIP archive signature.
BytePatternTableRow { "\x50\x4B\x03\x04"sv, "\xFF\xFF\xFF\xFF"sv, no_ignored_bytes, "application/zip"sv }, BytePatternTableRow { "\x50\x4B\x03\x04"sv, "\xFF\xFF\xFF\xFF"sv, no_ignored_bytes, "application/zip"sv },
// The string "Rar " followed by SUB BEL NUL, the RAR archive signature. // The string "Rar!" followed by SUB BEL NUL, the RAR 4.x archive signature.
BytePatternTableRow { "\x52\x61\x72\x20\x1A\x07\x00"sv, "\xFF\xFF\xFF\xFF\xFF\xFF\xFF"sv, no_ignored_bytes, "application/x-rar-compressed"sv }, BytePatternTableRow { "\x52\x61\x72\x21\x1A\x07\x00"sv, "\xFF\xFF\xFF\xFF\xFF\xFF\xFF"sv, no_ignored_bytes, "application/x-rar-compressed"sv },
}; };
for (auto const& row : pattern_table) { for (auto const& row : pattern_table) {

View file

@ -159,7 +159,7 @@ TEST_CASE(determine_computed_mime_type_in_both_none_and_browsing_sniffing_contex
mime_type_to_headers_map.set("application/x-gzip"sv, { "\x1F\x8B\x08"sv }); mime_type_to_headers_map.set("application/x-gzip"sv, { "\x1F\x8B\x08"sv });
mime_type_to_headers_map.set("application/zip"sv, { "PK\x03\x04"sv }); mime_type_to_headers_map.set("application/zip"sv, { "PK\x03\x04"sv });
mime_type_to_headers_map.set("application/x-rar-compressed"sv, { "Rar\x20\x1A\x07\x00"sv }); mime_type_to_headers_map.set("application/x-rar-compressed"sv, { "Rar!\x1A\x07\x00"sv });
for (auto const& mime_type_to_headers : mime_type_to_headers_map) { for (auto const& mime_type_to_headers : mime_type_to_headers_map) {
auto mime_type = mime_type_to_headers.key; auto mime_type = mime_type_to_headers.key;