Header returns the http.Header representation of the GET options.
()
| 65 | |
| 66 | // Header returns the http.Header representation of the GET options. |
| 67 | func (o GetObjectOptions) Header() http.Header { |
| 68 | headers := make(http.Header, len(o.headers)) |
| 69 | for k, v := range o.headers { |
| 70 | headers.Set(k, v) |
| 71 | } |
| 72 | if o.ServerSideEncryption != nil && o.ServerSideEncryption.Type() == encrypt.SSEC { |
| 73 | o.ServerSideEncryption.Marshal(headers) |
| 74 | } |
| 75 | // this header is set for active-active replication scenario where GET/HEAD |
| 76 | // to site A is proxy'd to site B if object/version missing on site A. |
| 77 | if o.Internal.ReplicationProxyRequest != "" { |
| 78 | headers.Set(minIOBucketReplicationProxyRequest, o.Internal.ReplicationProxyRequest) |
| 79 | } |
| 80 | if o.Checksum { |
| 81 | headers.Set("x-amz-checksum-mode", "ENABLED") |
| 82 | } |
| 83 | return headers |
| 84 | } |
| 85 | |
| 86 | // Set adds a key value pair to the options. The |
| 87 | // key-value pair will be part of the HTTP GET request |