Skip to content

fix(photo-addon): add referrer policy for OSM map tiles#360

Open
paul43210 wants to merge 2 commits intoowncloud:mainfrom
paul43210:fix-photo-addon-map-referer
Open

fix(photo-addon): add referrer policy for OSM map tiles#360
paul43210 wants to merge 2 commits intoowncloud:mainfrom
paul43210:fix-photo-addon-map-referer

Conversation

@paul43210
Copy link
Copy Markdown
Contributor

Summary

  • OSM tile servers require a Referer header, but oCIS may set a strict Referrer-Policy that strips it
  • Injects <meta name="referrer" content="no-referrer-when-downgrade"> when the map initializes (restored on unmount)
  • Sets referrerPolicy on each tile <img> element via custom TileLayer
  • Failed tiles automatically retry once after 500ms

Test plan

  • Open map view — verify no 403 errors on OSM tiles
  • Pan and zoom the map — verify all tiles load correctly
  • Switch away from map view and back — verify tiles still load

🤖 Generated with Claude Code

@mmattel
Copy link
Copy Markdown
Contributor

mmattel commented Mar 23, 2026

failing tests: typecheck + pnpm check:types

web-extensions@ check:types /drone/src
pnpm -r check:types

Scope: 9 of 10 workspace projects
packages/web-app-advanced-search check:types$ vue-tsc --noEmit
packages/web-app-cast check:types$ vue-tsc --noEmit
packages/web-app-draw-io check:types$ vue-tsc --noEmit
packages/web-app-importer check:types$ vue-tsc --noEmit
packages/web-app-cast check:types: Done
packages/web-app-json-viewer check:types$ vue-tsc --noEmit
packages/web-app-importer check:types: Done
packages/web-app-photo-addon check:types$ vue-tsc --noEmit
packages/web-app-draw-io check:types: Done
packages/web-app-progress-bars check:types$ vue-tsc --noEmit
packages/web-app-advanced-search check:types: Done
packages/web-app-unzip check:types$ vue-tsc --noEmit
packages/web-app-json-viewer check:types: Done
packages/web-app-progress-bars check:types: Done
packages/web-app-photo-addon check:types: src/components/PhotoMap.vue(492,42): error TS2445: Property 'createTile' is protected and only accessible within class 'GridLayer' and its subclasses.
packages/web-app-photo-addon check:types: src/components/PhotoMap.vue(505,20): error TS2554: Expected 0 arguments, but got 2.
packages/web-app-unzip check:types: Done
packages/web-app-photo-addon check:types: Failed
/drone/src/packages/web-app-photo-addon:
 ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  photo-addon@0.2.0 check:types: vue-tsc --noEmit
Exit status 2
 ELIFECYCLE  Command failed with exit code 2.

@paul43210
Copy link
Copy Markdown
Contributor Author

Fixed the TypeScript errors — replaced L.TileLayer.extend() (which accessed the protected createTile method) with Leaflet's event-based approach using tileloadstart and tileerror events. Same functionality, clean types.

paul43210 and others added 2 commits March 26, 2026 11:45
OSM's tile servers require a Referer header, but oCIS may set a strict
Referrer-Policy that strips it, causing intermittent 403 errors on map
tiles. Fix: inject a meta referrer tag and set referrerPolicy on each
tile image element. Failed tiles retry once after 500ms.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace L.TileLayer.extend() with event-based approach using
tileloadstart/tileerror events. The previous approach accessed
the protected createTile method, causing TypeScript errors in CI.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@paul43210 paul43210 force-pushed the fix-photo-addon-map-referer branch from 55ef797 to 4fe0d17 Compare March 26, 2026 15:45
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.

2 participants