Skip to content

Fix/thumbnail fix#7

Merged
bbrauzzi merged 3 commits into
developfrom
fix/thumbnail-fix
Jun 4, 2026
Merged

Fix/thumbnail fix#7
bbrauzzi merged 3 commits into
developfrom
fix/thumbnail-fix

Conversation

@bbrauzzi

@bbrauzzi bbrauzzi commented Jun 4, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes the CORS error that broke quicklook thumbnails in the deployed GitHub Pages app, plus repo housekeeping.

Thumbnail CORS fix

The STAC API is fine in prod (stac.dataspace.copernicus.eu sends Access-Control-Allow-Origin: *). The real problem was thumbnails: their hrefs point at datahub.creodias.eu, which 301-redirects to the same path on zipper.creodias.eu. Only the
final zipper response carries CORS headers — the redirect does not — and the browser enforces CORS on every redirect hop, so the maplibre WebGL texture fetch (crossOrigin='anonymous') was blocked before reaching the image.

thumbForMap in src/components/MapView.tsx now rewrites the datahub host straight to zipper.creodias.eu in production, skipping the redirect. Dev still proxies via /thumb. Zero infrastructure — just a URL rewrite.

Docs & metadata

  • Add MIT LICENSE + license/homepage/repository fields in package.json.
  • Add live demo link, License section, and CI/demo/license/stack badges to the README.
  • Correct the README CORS note to match reality.
  • Bump version to 1.0.1 and translate the package description to English.

Test plan

  • npm run build passes; npm test green (37/37), MapView prod test updated to assert the zipper.creodias.eu rewrite.
  • Manual: build + preview, select a Sentinel-2 item with imagery on — overlay renders, no CORS error, image hits zipper.creodias.eu (no blocked 301).

bbrauzzi and others added 3 commits June 4, 2026 19:51
…irect

Thumbnail hrefs point at datahub.creodias.eu, which 301-redirects to the
identical path on zipper.creodias.eu. Only the final zipper response carries
CORS headers; the 301 from datahub does not. Since the browser enforces CORS
on every hop of a redirect chain, the maplibre WebGL texture fetch (crossOrigin
'anonymous') was blocked at the redirect before reaching the CORS-* image,
breaking thumbnails on GitHub Pages.

In prod, thumbForMap now rewrites the datahub host straight to zipper, skipping
the redirect entirely. Dev still proxies via /thumb (followRedirects).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Add LICENSE (MIT) and "license"/"homepage"/"repository" fields in package.json.
- Add a License section and a live demo link to the GitHub Pages deployment.
- Add CI, demo, license, and stack badges to the README header.
- Correct the CORS note: the STAC API sends Access-Control-Allow-Origin: *, so
  no proxy is needed for data; document the datahub->zipper thumbnail redirect
  and the host-rewrite fix instead.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…lish

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bbrauzzi bbrauzzi merged commit fd1b94c into develop Jun 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant