1
0
mirror of https://github.com/distribution/distribution synced 2024-11-12 05:45:51 +01:00

Merge pull request #894 from aaronlehmann/fix-tests

Fix tests after #846
This commit is contained in:
Olivier Gambier 2015-08-18 13:57:13 -07:00
commit ed7cc91e6f

@ -1248,8 +1248,10 @@ func checkResponse(t *testing.T, msg string, resp *http.Response, expectedStatus
t.FailNow()
}
// We expect the headers included in the configuration
if !reflect.DeepEqual(resp.Header["X-Content-Type-Options"], []string{"nosniff"}) {
// We expect the headers included in the configuration, unless the
// status code is 405 (Method Not Allowed), which means the handler
// doesn't even get called.
if resp.StatusCode != 405 && !reflect.DeepEqual(resp.Header["X-Content-Type-Options"], []string{"nosniff"}) {
t.Logf("missing or incorrect header X-Content-Type-Options %s", msg)
maybeDumpResponse(t, resp)