From 48708ca0d50d26b28690e3f15ea610dc6e664d53 Mon Sep 17 00:00:00 2001 From: Jeffrey Morgan Date: Sat, 19 Oct 2024 17:06:41 -0400 Subject: [PATCH] server: allow vscode-webview origin (#7273) --- envconfig/config.go | 1 + envconfig/config_test.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/envconfig/config.go b/envconfig/config.go index 44a87995..db2a5625 100644 --- a/envconfig/config.go +++ b/envconfig/config.go @@ -72,6 +72,7 @@ func Origins() (origins []string) { "app://*", "file://*", "tauri://*", + "vscode-webview://*", ) return origins diff --git a/envconfig/config_test.go b/envconfig/config_test.go index 7ac7c53e..735b4540 100644 --- a/envconfig/config_test.go +++ b/envconfig/config_test.go @@ -68,6 +68,7 @@ func TestOrigins(t *testing.T) { "app://*", "file://*", "tauri://*", + "vscode-webview://*", }}, {"http://10.0.0.1", []string{ "http://10.0.0.1", @@ -86,6 +87,7 @@ func TestOrigins(t *testing.T) { "app://*", "file://*", "tauri://*", + "vscode-webview://*", }}, {"http://172.16.0.1,https://192.168.0.1", []string{ "http://172.16.0.1", @@ -105,6 +107,7 @@ func TestOrigins(t *testing.T) { "app://*", "file://*", "tauri://*", + "vscode-webview://*", }}, {"http://totally.safe,http://definitely.legit", []string{ "http://totally.safe", @@ -124,6 +127,7 @@ func TestOrigins(t *testing.T) { "app://*", "file://*", "tauri://*", + "vscode-webview://*", }}, } for _, tt := range cases {