[PR #5576] fix: missing Sec-WebSocket-Protocol header in websocket request when App reopened #5268

Open
opened 2026-03-17 02:43:55 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/5576
Author: @Vickyraz
Created: 11/12/2025
Status: 🔄 Open

Base: mainHead: bug-fix-3909


📝 Commits (3)

  • 3d38053 fix: missing Sec-WebSocket-Protocol header in websocket request when App reopend
  • 35b7427 Merge branch 'main' of github.com-personal:Vickyraz/hoppscotch into bug-fix-3909
  • c83eb3e fix: Added explicit typings to getActiveProtocols

📊 Changes

1 file changed (+8 additions, -7 deletions)

View changed files

📝 packages/hoppscotch-common/src/pages/realtime/websocket.vue (+8 -7)

📄 Description

Closes #3909

When Hoppscotch is reopened, previously set protocols in Websocket requests are not sent in the Sec-WebSocket-Protocol header. This happens because the activeProtocols is not a session variable and needs to be calculated in onMounted event.

What's changed

  • Extracted the callback method in watchers for reuse
  • Used the extracted method during onMounted to get the current active protocols

Summary by cubic

Fixes missing Sec-WebSocket-Protocol header on WebSocket requests after reopening the app. We now recalculate active protocols on mount using a shared helper, so selected protocols are always sent.

Written for commit c83eb3ed51. Summary will update automatically on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/5576 **Author:** [@Vickyraz](https://github.com/Vickyraz) **Created:** 11/12/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `bug-fix-3909` --- ### 📝 Commits (3) - [`3d38053`](https://github.com/hoppscotch/hoppscotch/commit/3d380536f2dcff77394430a94a3ce02b37c9614f) fix: missing Sec-WebSocket-Protocol header in websocket request when App reopend - [`35b7427`](https://github.com/hoppscotch/hoppscotch/commit/35b74276bbe2af52f65c1de9036fec5d0a5af8cc) Merge branch 'main' of github.com-personal:Vickyraz/hoppscotch into bug-fix-3909 - [`c83eb3e`](https://github.com/hoppscotch/hoppscotch/commit/c83eb3ed51cf1c902d37862e249612eb8fe1be81) fix: Added explicit typings to getActiveProtocols ### 📊 Changes **1 file changed** (+8 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-common/src/pages/realtime/websocket.vue` (+8 -7) </details> ### 📄 Description <!-- Thanks for creating this pull request 🤗 Please make sure that the pull request is limited to one type (docs, feature, etc.) and keep it as small as possible. You can open multiple prs instead of opening a huge one. --> <!-- If this pull request closes an issue, please mention the issue number below --> Closes #[3909](https://github.com/hoppscotch/hoppscotch/issues/3909) <!-- Add an introduction into what this PR tries to solve in a couple of sentences --> When Hoppscotch is reopened, previously set protocols in Websocket requests are not sent in the `Sec-WebSocket-Protocol` header. This happens because the activeProtocols is not a session variable and needs to be calculated in onMounted event. ### What's changed <!-- Describe point by point the different things you have changed in this PR --> - Extracted the callback method in watchers for reuse - Used the extracted method during onMounted to get the current active protocols <!-- You can also choose to add a list of changes and if they have been completed or not by using the markdown to-do list syntax - [ ] Not Completed - [x] Completed --> <!-- ### Notes to reviewers --> <!-- Any information you feel the reviewer should know about when reviewing your PR --> <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes missing Sec-WebSocket-Protocol header on WebSocket requests after reopening the app. We now recalculate active protocols on mount using a shared helper, so selected protocols are always sent. <sup>Written for commit c83eb3ed51cf1c902d37862e249612eb8fe1be81. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#5268
No description provided.