-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cloudflare Pages/NextJS bug #80
Comments
Can you give more details on how you're configuring and using Edge-CSRF? The tests are run in the miniflare environment and this error hasn't shown up so far. |
@isaacrowntree Do you have any updates on this? Were you able to fix the issue with ReadableStream? |
* Modifies getTokenString(), clones request before reading it * Add next15-cloudflare-pages example Fixes #80
I tried cloning the request using |
I am hitting the same issue; I think it's worth creating an issue in https://github.com/cloudflare/next-on-pages/issues since I don't think this package is doing anything wrong now |
@Gbuomprisco Done. Thanks for the suggestion! cloudflare/next-on-pages#920 |
Thank you, appreciate it 🙏 |
Because of the way the csrfMiddleware interacts with the ReadableStream in the request it throws an error that the 'ReadableStream' has already been parsed.
The specific error:
TypeError: This ReadableStream is disturbed (has already been read from), and cannot be used as a body.
I'm going to have to roll my own csrfProtect function which does a clone of the ReadableStream in order to avoid disturbing it in order to avoid this error at least until you can come with an alternative.
The text was updated successfully, but these errors were encountered: