Fix WebSocket protocol upgrade in DWDS injected client  (#2868)

Fixes an issue where WebSocket URLs were not upgraded from ws:// to wss:// when the application is served over HTTPS (window.location.protocol == 'https:') on non-localhost hosts.

Previously, _fixProtocol checked `window.location.protocol == 'wss:'`, which is never true for browser pages, leaving ws:// connections unchanged and causing mixed-content blocking in browsers.

Extracts the logic into an internal utility function `fixProtocol` and adds unit tests.
7 files changed
tree: f2248c441894bab026b4b599cbea481bc1997d9b
  1. .github/
  2. _analysis_config/
  3. debug_extension/
  4. dwds/
  5. dwds_test_common/
  6. example/
  7. frontend_server_client/
  8. tool/
  9. webdev/
  10. .gitattributes
  11. .gitignore
  12. AUTHORS
  13. CONTRIBUTING.md
  14. mono_repo.yaml
  15. README.md
README.md

Dart

Packages

PackageDescriptionVersion
dwdsA service that proxies between the Chrome debug protocol and the Dart VM service protocol.pub package
frontend_server_clientClient code to start and interact with the frontend_server compiler from the Dart SDK.pub package
webdevA CLI for Dart web development. Provides an easy and consistent set of features for users and tools to build and deploy web applications with Dart.pub package

Publishing automation

For information about our publishing automation and release process, see https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.