jpillora / grunt-aws

A Grunt interface into the Amazon Node.JS SDK
171 stars 44 forks source link

CacheControl set as string #35

Closed lukebussey closed 8 years ago

lukebussey commented 9 years ago

Currently the Cache-control header can only be set using a number or object, but the header is a string and can accept more than just the values allowed.

I propose that it accepts a number, an object, OR a string. Where string is the value of the header you wish to set. E.g.

options: {
  headers: {
    CacheControl: "public, must-revalidate, no-transform, max-age=900, s-maxage=60"
  }
}

The specs detail all of the header values here: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9

I'd be happy to open a pull request and make the change backwards compatible. Any thoughts?

jpillora commented 9 years ago

@lukebussey Yep, sounds like a reasonable change.

lukebussey commented 9 years ago

This already works! I should have checked the source more carefully.

headers: {
  CacheControl: 'public, must-revalidate'
}

I'll submit a pull request with updated documentation soon.