We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8783ab6 commit b960a74Copy full SHA for b960a74
test/proxy.test.ts
@@ -399,23 +399,23 @@ describe("", () => {
399
});
400
401
it("allows to get the actual response", async () => {
402
- let proxyResponse;
+ let headers;
403
404
app.use(
405
"/",
406
eventHandler((event) => {
407
return proxyRequest(event, url + "/debug", {
408
fetch,
409
- async onResponse(_event, response) {
410
- proxyResponse = await response.json();
+ onResponse(_event, response) {
+ headers = Object.fromEntries(response.headers.entries());
411
},
412
413
})
414
);
415
416
await request.get("/");
417
418
- expect(proxyResponse).toEqual({ foo: "bar" });
+ expect(headers["content-type"]).toEqual("application/json");
419
420
421
0 commit comments