File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -65,18 +65,26 @@ func (p *Plugin) Init(cfg Configurer) error {
6565 }
6666
6767 if p .cfg .CORS .AllowedOrigin != "" {
68+ // trim all spaces
69+ p .cfg .CORS .AllowedOrigin = strings .Trim (p .cfg .CORS .AllowedOrigin , " " )
6870 opts .AllowedOrigins = strings .Split (p .cfg .CORS .AllowedOrigin , "," )
6971 }
7072
7173 if p .cfg .CORS .AllowedMethods != "" {
74+ // trim all spaces
75+ p .cfg .CORS .AllowedMethods = strings .Trim (p .cfg .CORS .AllowedMethods , " " )
7276 opts .AllowedMethods = strings .Split (p .cfg .CORS .AllowedMethods , "," )
7377 }
7478
7579 if p .cfg .CORS .AllowedHeaders != "" {
80+ // trim all spaces
81+ p .cfg .CORS .AllowedHeaders = strings .Trim (p .cfg .CORS .AllowedHeaders , " " )
7682 opts .AllowedHeaders = strings .Split (p .cfg .CORS .AllowedHeaders , "," )
7783 }
7884
7985 if p .cfg .CORS .ExposedHeaders != "" {
86+ // trim all spaces
87+ p .cfg .CORS .ExposedHeaders = strings .Trim (p .cfg .CORS .ExposedHeaders , " " )
8088 opts .ExposedHeaders = strings .Split (p .cfg .CORS .ExposedHeaders , "," )
8189 }
8290
You can’t perform that action at this time.
0 commit comments