Skip to content

Make interop-related JSON data available via CORS #4483

@gsnedders

Description

@gsnedders

To get the list of tests in Interop, you need to load:

  1. https://wpt.fyi/static/interop-data.json
  2. https://wpt.fyi/api/metadata?product=chrome&includeTestLevel

Neither of these are accessible cross-origin currently:

gsnedders@gsnedders-margot ~ % curl -I 'https://wpt.fyi/static/interop-data.json'
HTTP/2 200 
date: Fri, 01 Aug 2025 16:50:44 GMT
content-type: application/json
content-length: 82831
vary: Accept-Encoding
server: nginx/1.26.3
last-modified: Mon, 28 Jul 2025 17:55:43 GMT
etag: "6887b99f-1438f"
accept-ranges: bytes
via: 1.1 google

gsnedders@gsnedders-margot ~ % curl -I 'https://wpt.fyi/api/metadata?product=chrome&includeTestLevel'
HTTP/2 400 
date: Fri, 01 Aug 2025 16:51:17 GMT
content-type: text/plain; charset=utf-8
content-length: 20
server: nginx/1.26.3
strict-transport-security: max-age=31536000; preload
x-content-type-options: nosniff
via: 1.1 google

webapp/web/nginx.conf I think controls the former.

For the latter, I thought this was:

wpt.fyi/api/routes.go

Lines 67 to 72 in 9300450

// API endpoint for searching Metadata for the products.
shared.AddRoute(
"/api/metadata",
"api-metadata",
shared.WrapApplicationJSON(shared.WrapPermissiveCORS(apiMetadataHandler)),
)

This already has shared.WrapPermissiveCORS, but

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions