Support COEP require-corp for public extension asset responses

オープン
#2,047 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
java
領域
api, backend

調査の方向性

Public assets are served from /vscode/asset/**, which 302s to the storage/CDN URL. Add Cross-Origin-Resource-Policy: cross-origin on both the redirect and the final public asset response, leaving existing CORS headers in place and not applying this to authenticated APIs. Done when a no-cors img load of an Open VSX icon works under COEP require-corp. CDN header changes for open-vsx.org may need EclipseFdn/open-vsx.org.

索引モデルが issue の本文から書いたものです。

説明

Description

Public extension assets served through Open VSX cannot currently be embedded by pages using:

Cross-Origin-Embedder-Policy: require-corp

when the resource is requested in no-cors mode, such as an <img> element without a crossorigin attribute.

This affects cross-origin-isolated web IDEs that load extension icons and other public assets from Open VSX. If the COOP/COEP headers are not configured, the SharedArrayBuffer of the origin server will not be usable.

Reproduction

Serve the following page with Cross-Origin-Embedder-Policy: require-corp:

<img src="https://open-vsx.org/vscode/asset/ms-python/vscode-python-envs/1.36.0/Microsoft.VisualStudio.Services.Icons.Default?targetPlatform=universal" />

Chromium blocks the request with an error similar to:

net::ERR_BLOCKED_BY_RESPONSE.NotSameOriginAfterDefaultedToSameOriginByCoep

Current response chain

The asset endpoint first returns a redirect:

GET https://open-vsx.org/vscode/asset/ms-python/vscode-python-envs/1.36.0/Microsoft.VisualStudio.Services.Icons.Default?targetPlatform=universal

HTTP/2 302
Location: https://openvsx.eclipsecontent.org/ms-python/vscode-python-envs/1.36.0/icon.png
Access-Control-Allow-Origin: <request origin>

The CDN then returns the image:

GET https://openvsx.eclipsecontent.org/ms-python/vscode-python-envs/1.36.0/icon.png

HTTP/2 200
Content-Type: image/png
Access-Control-Allow-Origin: *

Neither response currently includes:

Cross-Origin-Resource-Policy: cross-origin

The existing CORS headers do not help when the resource is requested in no-cors mode. Under COEP: require-corp, a response without a valid CORP header
defaults to same-origin and is therefore blocked.

The Fetch Standard performs the CORP check before following an HTTP redirect, so both the initial redirect response and the final CDN response need to opt in:

https://fetch.spec.whatwg.org/#http-fetch

Expected behavior

Public extension assets should be loadable from cross-origin-isolated applications using COEP: require-corp.

Suggested direction

For public extension asset delivery:

  • Add Cross-Origin-Resource-Policy: cross-origin to responses from public asset endpoints such as /vscode/asset/**, including redirect responses.
  • Ensure the final resource returned by the configured storage provider or CDN also includes the same header.
  • Keep the existing CORS headers for consumers that explicitly use CORS mode.
  • Scope this behavior to public extension assets rather than authenticated or user-specific API responses.

The final CDN header may require deployment-specific configuration for the public open-vsx.org instance. The core implementation could define or document the
required response-header contract, with the corresponding infrastructure change tracked in EclipseFdn/open-vsx.org if necessary.

主要言語
Java
スター
2.1k
フォーク
362
平均マージ
1日 3時間
マージ済み PR(30日)
44

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

eclipse-openvsx/openvsx のほかの issue

eclipse-openvsx/openvsx の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。