Code-server: [V2] Documentation - Breaking change for Reverse proxy

Created on 22 Oct 2019  路  4Comments  路  Source: cdr/code-server


  • code-server version: v10.15.1
  • OS Version: docker:latest
  • VS Code Version:
Version: 1.39.2
Commit: f133b00851c6c05aedaf78ff139443a46cd8d036
Date: 2019-10-21T22:06:51.355Z
Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36

Description

I have a similar issue to #997 after upgrading to V2, but it's different enough to warrent a separate issue.

I'm getting a 404, not found after upgrade for all web views (extension readme's, markdown preview etc.). But I don't think it's code-server's fault it's my reverse proxy config. I'm not sure the exact changes, but I think because I have some path matchers on my reverse proxy it's rejecting /webview paths as not found. because something obviously changed between v1 and v2, it should probably be documented.

bug

All 4 comments

Duplicate of #997

@sr229 just an FYI, I'm not sure it's a direct duplicate. I'm actually getting 404 responses from my reverse proxy.
I don't get the following console message documented in the related issue

Service Workers are not enabled. Webviews will not work properly
Blocked script execution in 'http://0.0.0.0:8080/webview/fake.html?id=extensionEditor' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.

Instead I get a 404 with my reverse-proxy 404 page. If code-server was erroring out on the server it would be a 5** error.

webviewElement.ts:167 GET https://myDomain.com/webview/index.html?id=extensionEditor 404
mountTo @ webviewElement.ts:167
show @ dynamicWebviewEditorOverlay.ts:95
claim @ dynamicWebviewEditorOverlay.ts:57
openMarkdown @ extensionEditor.ts:585
async function (async)
openMarkdown @ extensionEditor.ts:579
openReadme @ extensionEditor.ts:826
open @ extensionEditor.ts:568
onNavbarChange @ extensionEditor.ts:556
(anonymous) @ extensionEditor.ts:425
fire @ event.ts:582
_update @ extensionEditor.ts:120
push @ extensionEditor.ts:105
updateTemplate @ extensionEditor.ts:428

as well as

The script has an unsupported MIME type ('text/html').

Which makes sense because what was returned was my reverse proxy 404 html page

This was my fault; I accidentally excluded the webview HTML from the final build. It should be fixed in the latest v2 Docker image.

@code-asher confirmed! Thank you for all of the awesome work!!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

balazssoltesz picture balazssoltesz  路  3Comments

grant picture grant  路  3Comments

pchecinski picture pchecinski  路  3Comments

justmao945 picture justmao945  路  3Comments

lshamis picture lshamis  路  3Comments