netlify/cli

Invalid character in header content ["Content-Security-Policy"]

Opened this issue · 0 comments

Describe the bug

Hi, I am trying to run npx netlify serve and I am running into the following issue:

`TypeError [ERR_INVALID_CHAR]: Invalid character in header content ["Content-Security-Policy"]
at ServerResponse.setHeader (node:_http_outgoing:706:3)
at file:///Users/andrea.dellacorte/Documents/Github/techinterview.coach/node_modules/netlify-cli/dist/utils/proxy.js:455:21
at Array.forEach ()
at ProxyServer. (file:///Users/andrea.dellacorte/Documents/Github/techinterview.coach/node_modules/netlify-cli/dist/utils/proxy.js:453:42)
at ProxyServer.emit (/Users/andrea.dellacorte/Documents/Github/techinterview.coach/node_modules/netlify-cli/node_modules/eventemitter3/index.js:183:35)
at ClientRequest. (/Users/andrea.dellacorte/Documents/Github/techinterview.coach/node_modules/netlify-cli/node_modules/http-proxy/lib/http-proxy/passes/web-incoming.js:173:27)
at ClientRequest.emit (node:events:519:28)
at ClientRequest.emit (node:domain:488:12)
at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:698:27)
at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17)

System:
OS: macOS 14.4.1
CPU: (8) arm64 Apple M1
Binaries:
Node: 21.7.2 - /opt/homebrew/bin/node
npm: 10.5.1 - /opt/homebrew/bin/npm
Browsers:
Chrome: 123.0.6312.107
Safari: 17.4.1`

Steps to reproduce

  1. Run npx netlify serve
  2. Wait for the console to fail

Configuration

No response

Environment

System:
    OS: macOS 14.4.1
    CPU: (8) arm64 Apple M1
    Memory: 148.27 MB / 8.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 21.7.2 - /opt/homebrew/bin/node
    npm: 10.5.1 - /opt/homebrew/bin/npm
  npmPackages:
    netlify-cli: ^17.21.2 => 17.21.2