SetContentEncoding - Sets content-encoding of the object for this policy
(contentEncoding string)
| 228 | |
| 229 | // SetContentEncoding - Sets content-encoding of the object for this policy |
| 230 | func (p *PostPolicy) SetContentEncoding(contentEncoding string) error { |
| 231 | if strings.TrimSpace(contentEncoding) == "" { |
| 232 | return errInvalidArgument("No content encoding specified.") |
| 233 | } |
| 234 | policyCond := policyCondition{ |
| 235 | matchType: "eq", |
| 236 | condition: "$Content-Encoding", |
| 237 | value: contentEncoding, |
| 238 | } |
| 239 | if err := p.addNewPolicy(policyCond); err != nil { |
| 240 | return err |
| 241 | } |
| 242 | p.formData["Content-Encoding"] = contentEncoding |
| 243 | return nil |
| 244 | } |
| 245 | |
| 246 | // SetContentLengthRange - Set new min and max content length |
| 247 | // condition for all incoming uploads. |
no test coverage detected