mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-04-24 14:15:18 +00:00
feat: enable cors by default for desktop app (#904)
This commit is contained in:
@@ -290,15 +290,18 @@
|
||||
"children": [
|
||||
{
|
||||
"key": "enable",
|
||||
"default_value": "false",
|
||||
"comment": "Whether to enable or disable cors headers.\nNote: If you want to put the frontend and the api on separate domains or ports, you will need to enable this.\nOtherwise the frontend won't be able to make requests to the api through the browser."
|
||||
"default_value": "true",
|
||||
"comment": "Whether to enable or disable cors headers.\nBy default, this is enabled only for requests from the desktop application running on localhost.\nNote: If you want to put the frontend and the api on separate domains or ports, you will need to adjust this setting accordingly."
|
||||
},
|
||||
{
|
||||
"key": "origins",
|
||||
"comment": "A list of origins which may access the api. These need to include the protocol (`http://` or `https://`) and port, if any.",
|
||||
"children": [
|
||||
{
|
||||
"default_value": "*"
|
||||
"default_value": "http://127.0.0.1:*"
|
||||
},
|
||||
{
|
||||
"default_value": "http://localhost:*"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -421,8 +421,8 @@ func InitDefaultConfig() {
|
||||
FilesBasePath.setDefault("files")
|
||||
FilesMaxSize.setDefault("20MB")
|
||||
// Cors
|
||||
CorsEnable.setDefault(false)
|
||||
CorsOrigins.setDefault([]string{"*"})
|
||||
CorsEnable.setDefault(true)
|
||||
CorsOrigins.setDefault([]string{"http://127.0.0.1:*", "http://localhost:*"})
|
||||
CorsMaxAge.setDefault(0)
|
||||
// Migration
|
||||
MigrationTodoistEnable.setDefault(false)
|
||||
|
||||
Reference in New Issue
Block a user