File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -7,19 +7,17 @@ import (
77
88func (t * HTTPServer ) corslayer (handler http.Handler ) http.Handler {
99 return http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
10+ headers := w .Header ()
11+ headers .Set ("Access-Control-Allow-Origin" , "*" )
1012 if r .Method != http .MethodOptions {
1113 handler .ServeHTTP (w , r )
1214 return
1315 }
1416
15- headers := w .Header ()
16-
1717 headers .Add ("Vary" , "Origin" )
1818 headers .Add ("Vary" , "Access-Control-Request-Method" )
1919 headers .Add ("Vary" , "Access-Control-Request-Headers" )
2020
21- headers .Set ("Access-Control-Allow-Origin" , "*" )
22-
2321 reqMethod := r .Header .Get ("Access-Control-Request-Method" )
2422 if reqMethod != "" {
2523 headers .Set ("Access-Control-Allow-Methods" , strings .ToUpper (reqMethod ))
You can’t perform that action at this time.
0 commit comments