solid-start icon indicating copy to clipboard operation
solid-start copied to clipboard

[Bug?]: Empty `Headers` object when preloading after form submission

Open samualtnorman opened this issue 1 year ago • 0 comments

Duplicates

  • [X] I have searched the existing issues

Latest version

  • [X] I have tested the latest version

Current behavior 😯

Get an empty headers object.

Expected behavior 🤔

Access to all the headers the browser sent.

Steps to reproduce 🕹

https://github.com/samualtnorman/solid-start-bug/tree/no-headers

Steps:

  1. Clone [email protected]:samualtnorman/solid-start-bug.git
  2. Switch to the no-headers branch
  3. Run pnpm dev
  4. Visit http://localhost:3000/
  5. Click the button
    • You should notice that the server logs an empty Headers object
    • If you refresh the page, a not empty headers object will be logged

Context 🔦

I'm trying to access the headers and make decisions based on that e.g. cookies.

Your environment 🌎

System:
    OS: NixOS 24.05.5744.dc2e0028d274 (Uakari) x86_64
    CPU: 12th Gen Intel(R) Core(TM) i5-12500 (12) @ 4.60 GHz
Binaries:
    Node: 22.9.0
    PNPM: 9.12.2
npmPackages:
    @solidjs/meta 0.29.4
    @solidjs/router 0.14.7
    @solidjs/start 1.0.8
    solid-js 1.9.1
    vinxi: 0.4.3

samualtnorman avatar Oct 18 '24 08:10 samualtnorman