Cannot enable CORS on snap-installed gitea #9036

Closed
opened 2025-11-02 08:26:39 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @DrPyser on GitHub (Jun 7, 2022).

Description

I'm trying to setup a local instance of gitea with CORS enabled to allow integration with tools that expect CORS-enabled APIs.
Despite editing the configuration with this snippet, there's no indication that the instance is correctly cors-enabled(e.g. no indication in configuration section of site administration view in UI) and the tool I'm trying to integrate is still complaining about invalid CORS responses.

[cors]
ENABLED = true
ALLOW_DOMAIN = *
SCHEME = http
ALLOW_CREDENTIALS = true

I installed through snap, so maybe the issue is related but I don't see how.

Gitea Version

Gitea version 1.16.8 built with GNU Make 4.1, go1.18.2 : bindata, sqlite, sqlite_unlock_notify, pam, cert

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

Ubuntu 20.04

How are you running Gitea?

running gitea web service as snap service.

Database

SQLite

Originally created by @DrPyser on GitHub (Jun 7, 2022). ### Description I'm trying to setup a local instance of gitea with CORS enabled to allow integration with tools that expect CORS-enabled APIs. Despite editing the configuration with this snippet, there's no indication that the instance is correctly cors-enabled(e.g. no indication in configuration section of site administration view in UI) and the tool I'm trying to integrate is still complaining about invalid CORS responses. ```ini [cors] ENABLED = true ALLOW_DOMAIN = * SCHEME = http ALLOW_CREDENTIALS = true ``` I installed through snap, so maybe the issue is related but I don't see how. ### Gitea Version Gitea version 1.16.8 built with GNU Make 4.1, go1.18.2 : bindata, sqlite, sqlite_unlock_notify, pam, cert ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System Ubuntu 20.04 ### How are you running Gitea? running gitea web service as snap service. ### Database SQLite
GiteaMirror added the type/bug label 2025-11-02 08:26:39 -06:00
Author
Owner

@DrPyser commented on GitHub (Jun 9, 2022):

For the records, I switched to using the docker image with a Caddy proxy to handle CORS instead.

@DrPyser commented on GitHub (Jun 9, 2022): For the records, I switched to using the docker image with a Caddy proxy to handle CORS instead.
Author
Owner

@wxiaoguang commented on GitHub (Apr 26, 2023):

IIRC, [cors] only works for API and a few web endpoints.

@wxiaoguang commented on GitHub (Apr 26, 2023): IIRC, `[cors]` only works for API and a few web endpoints.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#9036