Skip to content
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

fix: do not automatically return Sec-WebSocket-Protocol header #142

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

eltigerchino
Copy link
Contributor

fixes #141

This PR includes a breaking change that modifies the behaviour of the Node and Deno adapters to no longer automatically accept the first WebSocket protocol the client sends. This makes the behaviour the same across all adapters and prevents errors for Node and Deno when trying to return the Sec-WebSocket-Protocol header from the upgrade hook.

@eltigerchino eltigerchino changed the title fix: do not automatically return Sec-WebSocket-Protocol headers fix: do not automatically return Sec-WebSocket-Protocol header Feb 24, 2025
"packageManager": "[email protected]"
"packageManager": "[email protected]",
"pnpm": {
"onlyBuiltDependencies": [
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This allows the installed deps to execute their build scripts after installing. Seems like it's necessary to add this list to avoid having to approve the builds every time we install packages.
https://pnpm.io/package_json#pnpmonlybuiltdependencies

@@ -1,5 +1,4 @@
import type { AdapterOptions, AdapterInstance, Adapter } from "../adapter.ts";
import type { WebSocket } from "../../types/web.ts";
Copy link
Contributor Author

@eltigerchino eltigerchino Feb 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This import wasn't being used so I removed it. The one that's being used is the import alias WebSocket as WebSocketT,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrectly returning multiple Sec-WebSocket-Protocol headers
1 participant