mirror of
https://github.com/gogs/gogs.git
synced 2026-07-01 03:28:44 +02:00
Able to set custom Access-Control-Allow-Origin header (#3987)
Added new config option '[http] ACCESS_CONTROL_ALLOW_ORIGIN'.
This commit is contained in:
@@ -156,6 +156,11 @@ func Contexter() macaron.Handler {
|
||||
},
|
||||
Org: &Organization{},
|
||||
}
|
||||
|
||||
if len(setting.HTTP.AccessControlAllowOrigin) > 0 {
|
||||
ctx.Header().Set("Access-Control-Allow-Origin", setting.HTTP.AccessControlAllowOrigin)
|
||||
}
|
||||
|
||||
// Compute current URL for real-time change language.
|
||||
ctx.Data["Link"] = setting.AppSubUrl + strings.TrimSuffix(ctx.Req.URL.Path, "/")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user