fix: Connection.resolveExternalWSUri should return ws or wss schema#639
fix: Connection.resolveExternalWSUri should return ws or wss schema#639scbrubaker02 wants to merge 1 commit intomicrosoft:mainfrom
Conversation
|
@microsoft-github-policy-service agree company="Udacity" |
|
@scbrubaker02 the command you issued was incorrect. Please try again. Examples are: and |
|
Can you create an issue associated with this? |
|
@andreamah , this addresses #645 |
|
This seems right, as it's making the behavior in vscode-livepreview/src/server/serverUtils/HTMLInjector.ts Lines 79 to 80 in 8573123 more universal across the repo. Currently, once I manually navigate to the websocket URL (as discussed in the FAQ, it seems to update just fine for me. In your case, do you do this and it still doesn't update properly? |
|
Actually, this change does not fix #645, which is the problem addressed in the FAQ, as pointed out by @andreamah . The only consequence that been able to observe while running the branch in codespaces is that a "Content-Security-Policy: Upgrading insecure request" warning disappears. The websocket where behavior is affected is not the one responsible for refresh but the one that handles the page history. Nevertheless, I do think that this is an improvement to code. It can be seen as an alternative fix for #175. |

Modifies the behavior
Connection.resolveExternalWSUriso that it returns as URI with a "ws" or "wss" scheme instead of a "http" or "https" scheme as it does currently.This avoids the need for callers of this function to correct the scheme in the results. Most importantly in the
WebviewCommthe scheme was always replaced with a "ws" scheme, resulting in errors likein secure contexts.
No other clients of the Connection class seem to rely on the behavior of returning an "http" or "https" schema.