Files
bun.sh/test/regression/issue/07397.test.ts
Ashcon Partovi dae985ab3c Fix Location header not being cloned from Response.redirect() (#7402)
* Fix `Location` header not being cloned from `Response.redirect()`

* Fix was something else
2023-12-01 16:35:28 -08:00

11 lines
361 B
TypeScript

import { test, expect } from "bun:test";
test("Response.redirect clones string from Location header", () => {
const url = new URL("http://example.com");
url.hostname = "example1.com";
const { href } = url;
expect(href).toBe("http://example1.com/");
const response = Response.redirect(href);
expect(response.headers.get("Location")).toBe(href);
});