You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While developing a module to add csrf support for h3, I've discovered that reading the body after reading it in the module middleware does not pass the symbol conditional and attempts to parse the body a second time which causes the request to hang.
Visit localhost:8080 to get the csrf cookie and then click the submit button.
Throwing a breakpoint on await h3.readBody and inspecting the call shows the symbol in the request object but the conditional fails and does not early out as expected.
This same behavior does not occur when read twice inside the same module. There is test demonstrating this in @chmking/h3-csrf
The text was updated successfully, but these errors were encountered:
chmking
changed the title
Reading body after reading body in seperate module hangs server
Reading body after reading body in seperate module hangs request
Sep 1, 2022
I've tried switching @chmking/h3-csrf to use h3 as a peerDependency with no improvement. After walking the code in the debugger it is very clear that it is not returning the parsed body from the previous call:
While developing a module to add csrf support for h3, I've discovered that reading the body after reading it in the module middleware does not pass the symbol conditional and attempts to parse the body a second time which causes the request to hang.
Visit localhost:8080 to get the csrf cookie and then click the submit button.
Throwing a breakpoint on
await h3.readBody
and inspecting the call shows the symbol in the request object but the conditional fails and does not early out as expected.This same behavior does not occur when read twice inside the same module. There is test demonstrating this in @chmking/h3-csrf
The text was updated successfully, but these errors were encountered: