Skip to content

Commit

Permalink
Add SetCacheControl on PostPolicy (#345)
Browse files Browse the repository at this point in the history
  • Loading branch information
kerams authored and kannappanr committed Oct 21, 2019
1 parent 2bda62a commit 79254b7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Minio/DataModel/PostPolicy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,21 @@ public void SetBucket(string bucket)
this.Bucket = bucket;
}

/// <summary>
/// Set cache control
/// </summary>
/// <param name="cacheControl">CacheControl for the policy</param>
public void SetCacheControl(string cacheControl)
{
if (string.IsNullOrEmpty(cacheControl))
{
throw new ArgumentException("Cache-Control argument cannot be null or empty", nameof(cacheControl));
}

this.policies.Add(Tuple.Create("eq", "$Cache-Control", cacheControl));
this.formData.Add("Cache-Control", cacheControl);
}

/// <summary>
/// Set content type policy.
/// </summary>
Expand Down

0 comments on commit 79254b7

Please sign in to comment.