vercel / serve-handler

The foundation of `serve`

Home Page:https://npmjs.com/serve-handler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't add headers to sourcemap files

ianstormtaylor opened this issue · comments

Using the headers option works fine for file.js but for file.js.map the headers never get applied...

      await serveHandler(req, res, {
        public: outdir,
        headers: [
          {
            source: 'file.js',
            headers: [
              {
                key: 'Access-Control-Allow-Origin',
                value: '*',
              },
            ],
          },
          {
            source: 'file.js.map',
            headers: [
              {
                key: 'Access-Control-Allow-Origin',
                value: '*',
              },
            ],
          },
        ],
      })

Tracked it down further up the stack, so not serve-handler's fault.