Skip to content

Commit ce2e942

Browse files
committed
this looks like something that one should check :|
1 parent 48127f0 commit ce2e942

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

file.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,12 @@ func (u URLLocation) GetFile(job *Job, path string, targetState FileState) (io.R
160160
if err != nil {
161161
return nil, FileState{}, fmt.Errorf("skipping %s: GET failed: %s", url, err.Error())
162162
}
163+
if response.StatusCode != 200 && response.StatusCode != 304 {
164+
return nil, FileState{}, fmt.Errorf(
165+
"skipping %s: GET returned unexpected status code: expected 200 or 304, but got %d",
166+
url, response.StatusCode,
167+
)
168+
}
163169

164170
return response.Body, FileState{
165171
Etag: response.Header.Get("Etag"),

0 commit comments

Comments
 (0)