File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -147,6 +147,24 @@ func Routes() *web.Route {
147147 routes .Get ("/metrics" , append (common , Metrics )... )
148148 }
149149
150+ ///*
151+ if setting .CORSConfig .Enabled {
152+ corsHandle := cors .Handler (cors.Options {
153+ //Scheme: setting.CORSConfig.Scheme, // FIXME: the cors middleware needs scheme option
154+ AllowedOrigins : setting .CORSConfig .AllowDomain ,
155+ //setting.CORSConfig.AllowSubdomain // FIXME: the cors middleware needs allowSubdomain option
156+ AllowedMethods : setting .CORSConfig .Methods ,
157+ AllowedHeaders : []string {"*" },
158+ // OptionsPassthrough: true,
159+ Debug : true ,
160+ AllowCredentials : setting .CORSConfig .AllowCredentials ,
161+ MaxAge : int (setting .CORSConfig .MaxAge .Seconds ()),
162+ })
163+ common = append (common , corsHandle )
164+ }
165+ //*/
166+
167+
150168 // Removed: toolbox.Toolboxer middleware will provide debug information which seems unnecessary
151169 common = append (common , context .Contexter ())
152170
You can’t perform that action at this time.
0 commit comments