Can not get Redirect Header from functions

I’m trying to

[[redirects]]
  from = "/api/:id/*"
  to = "/.netlify/functions/:splat"
  status = 200
  headers = {X-Custom-Header = ":id"}

get the :id and turn that into a header and pass it to the functions. Even when I do

[[redirects]]
  from = "/api/:id/*"
  to = "/.netlify/functions/:splat"
  status = 200
  headers = {X-Netlify-Hostname = "host1.com"}

I do not get anything in the functions being called. I have

  console.log(event)

inside the function. The output looks like

{ path: '/.netlify/functions/hello-world',
  httpMethod: 'GET',
  queryStringParameters: { name: 'John' },
  headers:
   { 'x-forwarded-for': '::1',
     'upgrade-insecure-requests': '1',
     cookie: SOME_COOKIES
     connection: 'close',
     'accept-encoding': 'gzip, deflate',
     'accept-language': 'en-GB,en;q=0.5',
     accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
     'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:69.0) Gecko/20100101 Firefox/69.0',
     host: 'localhost:8888',
     'client-ip': '::1' },
  body: '[object Object]',
  isBase64Encoded: false }

As you can see the custom header is not in the header tag.

I think we will only apply headers to requests that are proxied to another site, @julianmcolina . For rewrites such as the one you reference I wouldn’t expect to see anything other than the headers from the requesting browser. If you proxy to a second netlify site (from /X to https://othersite.netlify.com/.netlify/functions/asdf for instance), then the header should show up in that request in addition to the browser’s request headers.