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
Upgrading a request to WebSockets should only be possible with GET requests. I verified this in production and took me a while to figure out that this was the thing that was going wrong. The following code sample shouldn't work.
Took me a while to figure out why my code wasn't working in production but was working with Miniflare. this was the reason. Will be great to have this fixed in miniflare.
I might be able to work on a PR this week. What are the preferences in terms of testing?
E.g. would a test called test("fetch: only performs web socket upgrade on GET requests") be ok?
In case I don't get round to it, I think it might be as simple as changing the following file: src/modules/standards.ts
before:
// Handle web socket upgradesif(request.headers.get("upgrade")==="websocket"){
after:
// Handle web socket upgrades, this should only for GET requestsif(request.method==="GET"&&request.headers.get("upgrade")==="websocket"){
The text was updated successfully, but these errors were encountered:
Upgrading a request to WebSockets should only be possible with
GET
requests. I verified this in production and took me a while to figure out that this was the thing that was going wrong. The following code sample shouldn't work.Took me a while to figure out why my code wasn't working in production but was working with Miniflare. this was the reason. Will be great to have this fixed in miniflare.
I might be able to work on a PR this week. What are the preferences in terms of testing?
E.g. would a test called
test("fetch: only performs web socket upgrade on GET requests")
be ok?In case I don't get round to it, I think it might be as simple as changing the following file:
src/modules/standards.ts
before:
after:
The text was updated successfully, but these errors were encountered: