facebook / sapling

A Scalable, User-Friendly Source Control System.
https://sapling-scm.com
GNU General Public License v2.0
6.18k stars 284 forks source link

Allow websockets to connect to the current browser's protocol of choice (if available) #886

Closed randallb closed 7 months ago

randallb commented 7 months ago

Allow websockets to connect to the current browser's protocol of choice (if available)

Summary: Adds a check for the current window's protocol. Defaults to ws:// but will switch to wss:// in secure contexts. This assumes the upstream server will handle converting from wss to ws.

Test plan: Import github project to replit. Run a server by doing: sl web --no-app

open the replit webview with the token, see if it loads the smartlog.

facebook-github-bot commented 7 months ago

@facebook-github-bot has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot commented 7 months ago

@randallb has updated the pull request. You must reimport the pull request before landing.

facebook-github-bot commented 7 months ago

@facebook-github-bot has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot commented 7 months ago

@randallb has updated the pull request. You must reimport the pull request before landing.

facebook-github-bot commented 7 months ago

@facebook-github-bot has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

randallb commented 7 months ago

I know the test plan is super weak sauce, but i was having trouble figuring out if it's worth testing against the window object at all...

facebook-github-bot commented 7 months ago

@evangrayk merged this pull request in facebook/sapling@3d3f507ab16d8516d4339d1ee7e99424b9bdc30e.