Commit 52107939 authored by Stan Hu's avatar Stan Hu

Fix static analysis failures in httprs

parent 150f645a
---
title: Vendor httprs module
merge_request: 550
author:
type: other
......@@ -47,14 +47,14 @@ var _ io.Seeker = (*HttpReadSeeker)(nil)
var (
// ErrNoContentLength is returned by Seek when the initial http response did not include a Content-Length header
ErrNoContentLength = errors.New("Content-Length was not set")
ErrNoContentLength = errors.New("header Content-Length was not set")
// ErrRangeRequestsNotSupported is returned by Seek and Read
// when the remote server does not allow range requests (Accept-Ranges was not set)
ErrRangeRequestsNotSupported = errors.New("Range requests are not supported by the remote server")
ErrRangeRequestsNotSupported = errors.New("range requests are not supported by the remote server")
// ErrInvalidRange is returned by Read when trying to read past the end of the file
ErrInvalidRange = errors.New("Invalid range")
ErrInvalidRange = errors.New("invalid range")
// ErrContentHasChanged is returned by Read when the content has changed since the first request
ErrContentHasChanged = errors.New("Content has changed since first request")
ErrContentHasChanged = errors.New("content has changed since first request")
)
// NewHttpReadSeeker returns a HttpReadSeeker, using the http.Response and, optionaly, the http.Client
......
......@@ -37,7 +37,7 @@ func (f *fakeResponseWriter) WriteHeader(code int) {
}
func (f *fakeResponseWriter) Response() *http.Response {
f.tmp.Seek(0, os.SEEK_SET)
f.tmp.Seek(0, io.SeekStart)
return &http.Response{Body: f.tmp, StatusCode: f.code, Header: f.h}
}
......@@ -167,7 +167,7 @@ func testHttpReaderSeeker(t *testing.T, newRS RSFactory) {
r := newRS()
So(r, ShouldNotBeNil)
defer r.Close()
s, err := r.Seek(4*64, os.SEEK_SET)
s, err := r.Seek(4*64, io.SeekStart)
So(s, ShouldEqual, 4*64)
So(err, ShouldBeNil)
buf := make([]byte, 4)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment