Skip to content

Commit 74b8a0f

Browse files
committed
fix tests
License: MIT Signed-off-by: Jeromy <[email protected]>
1 parent bdc1b27 commit 74b8a0f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

commands/http/handler_test.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import (
1111
coremock "github.com/ipfs/go-ipfs/core/mock"
1212
)
1313

14+
const AllowedExposedHeaders = "X-Stream-Output, X-Chunked-Output"
15+
1416
func assertHeaders(t *testing.T, resHeaders http.Header, reqHeaders map[string]string) {
1517
for name, value := range reqHeaders {
1618
if resHeaders.Get(name) != value {
@@ -170,7 +172,7 @@ func TestAllowedOrigins(t *testing.T) {
170172
ACAMethods: "",
171173
ACACredentials: "",
172174
"Access-Control-Max-Age": "",
173-
"Access-Control-Expose-Headers": "",
175+
"Access-Control-Expose-Headers": AllowedExposedHeaders,
174176
},
175177
Code: http.StatusOK,
176178
}
@@ -198,7 +200,7 @@ func TestWildcardOrigin(t *testing.T) {
198200
ACAMethods: "",
199201
ACACredentials: "",
200202
"Access-Control-Max-Age": "",
201-
"Access-Control-Expose-Headers": "",
203+
"Access-Control-Expose-Headers": AllowedExposedHeaders,
202204
},
203205
Code: http.StatusOK,
204206
}
@@ -258,7 +260,7 @@ func TestAllowedReferer(t *testing.T) {
258260
ACAMethods: "",
259261
ACACredentials: "",
260262
"Access-Control-Max-Age": "",
261-
"Access-Control-Expose-Headers": "",
263+
"Access-Control-Expose-Headers": AllowedExposedHeaders,
262264
},
263265
Code: http.StatusOK,
264266
}
@@ -286,7 +288,7 @@ func TestWildcardReferer(t *testing.T) {
286288
ACAMethods: "",
287289
ACACredentials: "",
288290
"Access-Control-Max-Age": "",
289-
"Access-Control-Expose-Headers": "",
291+
"Access-Control-Expose-Headers": AllowedExposedHeaders,
290292
},
291293
Code: http.StatusOK,
292294
}

0 commit comments

Comments
 (0)