Merge pull request #69013 from ibrasho-forks/switch-to-http.Error

Update usages of http.ResponseWriter.WriteHeader to use http.Error
This commit is contained in:
k8s-ci-robot
2018-10-23 15:31:55 -07:00
committed by GitHub
12 changed files with 29 additions and 32 deletions

View File

@@ -140,7 +140,7 @@ func TestMarkMaster(t *testing.T) {
if req.URL.Path != "/api/v1/nodes/"+hostname {
t.Errorf("MarkMaster(%s): request for unexpected HTTP resource: %v", tc.name, req.URL.Path)
w.WriteHeader(http.StatusNotFound)
http.Error(w, "", http.StatusNotFound)
return
}
@@ -150,7 +150,7 @@ func TestMarkMaster(t *testing.T) {
patchRequest = toString(req.Body)
default:
t.Errorf("MarkMaster(%s): request for unexpected HTTP verb: %v", tc.name, req.Method)
w.WriteHeader(http.StatusNotFound)
http.Error(w, "", http.StatusNotFound)
return
}