ladle icon indicating copy to clipboard operation
ladle copied to clipboard

Internal server error: Header name must be a valid HTTP token [":path"]

Open wojtekmaj opened this issue 7 months ago • 2 comments

Describe the bug

When using Ladle + vite-plugin-ssl with server.proxy, the following error appears on the server:

Internal server error: Header name must be a valid HTTP token [":path"]

I initially thought it's a regression of https://github.com/vitejs/vite/issues/484, but turns out it's not: workaround for https://github.com/vitejs/vite/issues/484 is still there. I dug down inside Ladle stuff and confirmed that the issue lies here:

https://github.com/tajo/ladle/blob/ff434ef02204bda9c19660edf358d151ac16a23d/packages/ladle/lib/cli/vite-dev.js#L134-L135

This piece of code lacks the exact same workaround Vite lacked back in the days.

When I replaced these two lines of code with:

      https
        .createServer(

Ladle + vite-plugin-ssl started working flawlessly with server.proxy.

Environment

System:
    OS: macOS 14.1.1
    CPU: (8) arm64 Apple M2
    Memory: 59.30 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.9.0 - /private/var/folders/3y/swkjq1x101b76mzjgt4pm2d80000gp/T/xfs-7e9663ff/node
    Yarn: 4.0.0 - /private/var/folders/3y/swkjq1x101b76mzjgt4pm2d80000gp/T/xfs-7e9663ff/yarn
    npm: 10.1.0 - /usr/local/bin/npm
    bun: 1.0.12 - ~/.bun/bin/bun
  Browsers:
    Chrome: 119.0.6045.159
    Edge: 119.0.2151.72
    Safari: 17.1

wojtekmaj avatar Nov 24 '23 08:11 wojtekmaj