Skip to content

Commit 74630ed

Browse files
chofnarandaaron
authored andcommitted
Added content-type to Access-Control-Allow-Headers needed for playground preflight
Signed-off-by: Catalin Hofnar <[email protected]>
1 parent 2929a62 commit 74630ed

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pkg/api/controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func (c *Controller) CORSHandler(response http.ResponseWriter, request *http.Req
7878
}
7979

8080
response.Header().Set("Access-Control-Allow-Methods", "HEAD,GET,POST,OPTIONS")
81-
response.Header().Set("Access-Control-Allow-Headers", "Authorization")
81+
response.Header().Set("Access-Control-Allow-Headers", "Authorization,content-type")
8282
}
8383

8484
func DumpRuntimeParams(log log.Logger) {

pkg/api/controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ func TestHtpasswdSingleCred(t *testing.T) {
269269
So(resp, ShouldNotBeNil)
270270
So(resp.StatusCode(), ShouldEqual, http.StatusOK)
271271

272-
header := []string{"Authorization"}
272+
header := []string{"Authorization,content-type"}
273273

274274
resp, _ = resty.R().SetBasicAuth(user, password).Options(baseURL + "/v2/")
275275
So(resp, ShouldNotBeNil)

0 commit comments

Comments
 (0)