newFromRequest creates a new ConditionalHeaders instance from the given HTTP request.
(c *Config, req *http.Request)
| 19 | |
| 20 | // newFromRequest creates a new ConditionalHeaders instance from the given HTTP request. |
| 21 | func newFromRequest(c *Config, req *http.Request) *Request { |
| 22 | ifModifiedSince := req.Header.Get(httpheaders.IfModifiedSince) |
| 23 | ifNoneMatch := req.Header.Get(httpheaders.IfNoneMatch) |
| 24 | |
| 25 | return &Request{ |
| 26 | config: c, |
| 27 | ifModifiedSince: ifModifiedSince, |
| 28 | ifNoneMatch: ifNoneMatch, |
| 29 | originHeaders: nil, |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | // SetOriginHeaders sets the origin headers for the request. |
| 34 | func (c *Request) SetOriginHeaders(h http.Header) { |