add 'arraybuffer' responseType to XHR

This commit is contained in:
Karl Seguin
2026-02-02 07:45:21 +08:00
parent 7c98a27c53
commit 176d42f625
3 changed files with 31 additions and 0 deletions

View File

@@ -558,6 +558,14 @@ fn testHTTPHandler(req: *std.http.Server.Request) !void {
});
}
if (std.mem.eql(u8, path, "/xhr/binary")) {
return req.respond(&.{ 0, 0, 1, 2, 0, 0, 9 }, .{
.extra_headers = &.{
.{ .name = "Content-Type", .value = "application/octet-stream" },
},
});
}
if (std.mem.startsWith(u8, path, "/src/browser/tests/")) {
// strip off leading / so that it's relative to CWD
return TestHTTPServer.sendFile(req, path[1..]);