Skip to content

API: Add OPTIONS request handler to serve CORS preflight requests #5133

Description

@techmatt101

Add support for CORS requests to the PhotoPrism API. Would like the option to pass new flags: --http-cors-allow-origins, --http-cors-allow-methods, and --http-cors-allow-headers. to enable web apps on different domains to call the PhotoPrism API directly, without needing a proxy.

Use case: I self-host PhotoPrism and run a separate photo frame app that fetches images via the PhotoPrism API. Without CORS headers, requests are blocked by the browser.

Note: This is not the same as PHOTOPRISM_CORS_ORIGIN, which controls image access from the PhotoPrism web app to external sources like CDNs.

Metadata

Metadata

Assignees

Labels

apiServer API endpoints and documentationideaFeedback wanted / feature requestreleasedAvailable in a stable releasesecurityImpact on server or browser security

Type

Projects

Status
Release 🌈

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions