NewObjectNotModified creates a new Reader with a 304 Not Modified status.
(headers http.Header)
| 69 | |
| 70 | // NewObjectNotModified creates a new Reader with a 304 Not Modified status. |
| 71 | func NewObjectNotModified(headers http.Header) *ObjectReader { |
| 72 | // Copy headers relevant to NotModified response only |
| 73 | nmHeaders := make(http.Header) |
| 74 | httpheaders.Copy( |
| 75 | headers, |
| 76 | nmHeaders, |
| 77 | []string{httpheaders.Etag, httpheaders.LastModified}, |
| 78 | ) |
| 79 | |
| 80 | return &ObjectReader{ |
| 81 | Status: http.StatusNotModified, |
| 82 | Headers: nmHeaders, |
| 83 | contentLength: 0, |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | // NewObjectInvalidRange creates a new Reader with a 416 Range Not Satisfiable status. |
| 88 | func NewObjectInvalidRange() *ObjectReader { |