Response Headers on custom netlify domain not working


I have an issue that headers are not in my response. Everything working fine on default netlify domain
( but on my custom domain ( I cant make any request to my server ( )
My custom domain has configure DNS on netlify

Thats my cors options and headers.

const corsOptions = {

  // origin: process.env.ORIGIN_URL

  origin: [





  credentials: true



app.use(function(req, res, next) {

  res.setHeader("Access-Control-Allow-Origin", "*"); // update to match the domain you will make the request from

  res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE');

  res.setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");

  res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With, Content-Type, Authorization, Content-Length, X-Api-Key');

  res.header('Access-Control-Allow-Credentials', 'true');



Hey @kalisz

I see the same headers on both as on (with the exception of the Link header and x-nf-request-id.)

% curl -I
HTTP/2 200
access-control-allow-methods: GET, POST, OPTIONS, PUT, PATCH, DELETE
access-control-allow-origin: *
age: 0
cache-control: public, max-age=0, must-revalidate
content-type: text/html; charset=UTF-8
date: Fri, 01 Apr 2022 22:40:05 GMT
etag: "2d4f4574080aa15e8fcd1513193a4a9e-ssl"
server: Netlify
strict-transport-security: max-age=63072000 includeSubDomains preload
test: test
x-nf-request-id: 01FZKMJ9ZPM7S9FHPKYFA76ZPM
content-length: 1364

Are you expecting to see all the headers in the code snippet you posted above?