Open
Description
Following the documentation I was able get the hello world edge function running and to verify it via the netlify cli. However when I switch out the body of the test.ts file with response edge function to:
import type { Context } from "https://edge.netlify.com";
export default async (request: Request, context: Context) => {
const url = new URL(request.url);
if (url.searchParams.get("method") !== "set-response-header") {
return context.next();
}
context.log(`Adding a custom header to the response for ${url}`);
const response = await context.next();
response.headers.set("X-Your-Custom-Header", "Your custom header value");
return response;
};
and update the netlify.tomi to
[[edge_functions]]
path = "/*"
function = "hello"
I can see that the edge function is◈ Loaded edge function hello
up via the --edgeInspect
flag, but when inspected the page I do not see the reponse header. Connecting the debugger doesn't lead to much helpful information that I can see.
Metadata
Metadata
Assignees
Labels
No labels