Skip to content

armgit / moli

Public Imported from GitHub
0

Best headless browser for AI agents. Lite, Fast, High-Compatibility. Built in Rust

test(fetch): cover MIME parameters in no-cors header fills

ldm0bb2cc3b8c311
diff --git a/moli-renderer-v8/src/script_vm/tests/no_cors_header_fill.rs b/moli-renderer-v8/src/script_vm/tests/no_cors_header_fill.rs
index 29ce0a7b7..b7f88fd03 100644
--- a/moli-renderer-v8/src/script_vm/tests/no_cors_header_fill.rs
+++ b/moli-renderer-v8/src/script_vm/tests/no_cors_header_fill.rs
@@ -4,7 +4,7 @@ use super::*;
async fn no_cors_header_fill_uses_append_guards_in_window_and_worker() {
let fixture = include_str!("../../../tests/fixtures/no-cors-header-fill.js");
for worker in [false, true] {
- let server = StaticHttpServer::spawn_echo(64).await;
+ let server = StaticHttpServer::spawn_echo(72).await;
let base = server.base_url();
let origin = serde_json::to_string(base.as_str().trim_end_matches('/')).unwrap();
let loader = static_http_loader([]);
@@ -52,7 +52,7 @@ async fn no_cors_header_fill_uses_append_guards_in_window_and_worker() {
.filter(|check| check["pass"] != true)
.collect();
assert_eq!(result["state"], "pass", "worker={worker}: {failures:?}");
- assert_eq!(checks.len(), 320, "worker={worker}");
- assert_eq!(server.finish().await.len(), 64, "worker={worker}");
+ assert_eq!(checks.len(), 360, "worker={worker}");
+ assert_eq!(server.finish().await.len(), 72, "worker={worker}");
}
}
diff --git a/moli-renderer-v8/tests/fixtures/no-cors-header-fill.js b/moli-renderer-v8/tests/fixtures/no-cors-header-fill.js
index 2d5a7d792..98243e163 100644
--- a/moli-renderer-v8/tests/fixtures/no-cors-header-fill.js
+++ b/moli-renderer-v8/tests/fixtures/no-cors-header-fill.js
@@ -13,6 +13,8 @@ async function noCorsFillProbe(base) {
const longType = 'text/plain;x=' + 'a'.repeat(114);
cases.push(
['type/duplicate', 'Content-Type', ['text/plain', 'text/plain'], 'text/plain', false],
+ ['type/parameter', 'Content-Type', ['text/plain;charset=utf8', 'extra'], 'text/plain;charset=utf8, extra', true],
+ ['type/parameter-second-type', 'Content-Type', ['text/plain;charset=utf8', 'application/json'], 'text/plain;charset=utf8, application/json', true],
['type/unsafe', 'Content-Type', ['text/plain;charset=utf8', '"'], 'text/plain;charset=utf8', false],
['type/invalid-first', 'Content-Type', ['application/json', 'text/plain'], 'text/plain', false],
['type/overflow', 'Content-Type', [longType, 'ok'], longType, false],