From c5c764d78fd069afc2cc43cfa1bff805dd5a169f Mon Sep 17 00:00:00 2001 From: Asher Date: Tue, 24 Jun 2025 18:21:26 -0800 Subject: [PATCH] Do not use module type for service worker It seems that this causes browser to not send cookies, which can result in a 401. Fixes #7389. --- CHANGELOG.md | 6 ++++++ patches/webview.diff | 11 ++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca3dd3acd..a16bb9380 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,12 @@ Code v99.99.999 ## Unreleased +Code v1.101.1 + +### Fixed + +- Fix web views not loading due to 401 when requesting the service worker. + ## [4.101.1](https://github.com/coder/code-server/releases/tag/v4.101.1) - 2025-06-20 Code v1.101.1 diff --git a/patches/webview.diff b/patches/webview.diff index 7ed4c32ff..d6002fa01 100644 --- a/patches/webview.diff +++ b/patches/webview.diff @@ -71,10 +71,19 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index -+ content="default-src 'none'; script-src 'sha256-1qYtPnTQa4VwKNJO61EOhs2agF9TvuQSYIJ27OgzZqI=' 'self'; frame-src 'self'; style-src 'unsafe-inline';"> ++ content="default-src 'none'; script-src 'sha256-Oi71Tq4Buohx0KDH3yEbVJUzABnqYv9iVLo420HZXqI=' 'self'; frame-src 'self'; style-src 'unsafe-inline';"> { + /** + * @param {MessageEvent} event @@ -351,6 +351,12 @@ const hostname = location.hostname;