Hi !
Following this thread:
I tried to set up a redirection with a custom header to a Netlify function. Here is my netlify.toml conf:
[[redirects]]
from = "/a"
to = "https://other-host.netlify.com/.netlify/functions/slug"
status = 200
force = true
headers = {X-From = "SLUG-A", X-Netlify-Hostname = "a.com"}
[[redirects]]
from = "/b"
to = "https://other-host.netlify.com/.netlify/functions/slug"
status = 200
force = true
headers = {X-From = "SLUG-B", X-Netlify-Hostname = "b.com"}
When running the project with netlify dev
, no problem, it’s working. I get the event.headers['x-netlify-hostname’]
or the event.headers['x-form’]
in my function handler, it’s working perfectly.
But when deployed on Netlify env, these headers are undefined.
Do you have a idea about what could be wrong with my setup ?
Thanks