Skip to content

Commit cfc1c61

Browse files
committed
update
1 parent 493b10b commit cfc1c61

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

coverage.out

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
mode: set
2-
github.com/GolangToolKits/grrt/router.go:25.25,28.2 2 1
3-
github.com/GolangToolKits/grrt/router.go:31.46,33.49 2 1
4-
github.com/GolangToolKits/grrt/router.go:36.2,36.12 1 1
5-
github.com/GolangToolKits/grrt/router.go:33.49,35.3 1 1
62
github.com/GolangToolKits/grrt/reqRoute.go:28.32,32.2 3 1
73
github.com/GolangToolKits/grrt/reqRoute.go:35.56,36.14 1 1
84
github.com/GolangToolKits/grrt/reqRoute.go:39.2,39.10 1 1
@@ -149,3 +145,7 @@ github.com/GolangToolKits/grrt/reqRouter.go:229.96,231.36 2 1
149145
github.com/GolangToolKits/grrt/reqRouter.go:236.2,237.27 2 1
150146
github.com/GolangToolKits/grrt/reqRouter.go:231.36,232.32 1 1
151147
github.com/GolangToolKits/grrt/reqRouter.go:232.32,234.4 1 1
148+
github.com/GolangToolKits/grrt/router.go:25.25,28.2 2 1
149+
github.com/GolangToolKits/grrt/router.go:31.46,33.49 2 1
150+
github.com/GolangToolKits/grrt/router.go:36.2,36.12 1 1
151+
github.com/GolangToolKits/grrt/router.go:33.49,35.3 1 1

reqRouter.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,9 @@ func (t *ReqRouter) SetCorsAllowedMethods(mths string) {
182182

183183
func (t *ReqRouter) handleCors(w http.ResponseWriter) {
184184
fmt.Println("inside handleCors ------")
185-
w.Header().Set(corsAllowOriginHeader, strings.Join(t.allowedOrigins, ","))
186-
w.Header().Set(corsAllowHeadersHeader, strings.Join(t.allowedHeaders, ","))
187-
w.Header().Set(corsAllowMethodsHeader, strings.Join(t.allowedMethods, ","))
185+
w.Header().Set(corsAllowOriginHeader, strings.Join(t.allowedOrigins, ", "))
186+
w.Header().Set(corsAllowHeadersHeader, strings.Join(t.allowedHeaders, ", "))
187+
w.Header().Set(corsAllowMethodsHeader, strings.Join(t.allowedMethods, ", "))
188188
w.WriteHeader(http.StatusOK)
189189
}
190190

reqRouter_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,7 @@ func TestReqRouter_handleCors(t *testing.T) {
987987
if tw.Header().Get("Access-Control-Allow-Origin") != "test" {
988988
t.Fail()
989989
}
990-
if tw.Header().Get("Access-Control-Allow-Methods") != "POST,GET" {
990+
if tw.Header().Get("Access-Control-Allow-Methods") != "POST, GET" {
991991
t.Fail()
992992
}
993993
})

0 commit comments

Comments
 (0)