Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[S3] Support for http caching headers #300

Open
mwhooker opened this issue Dec 16, 2014 · 1 comment
Open

[S3] Support for http caching headers #300

mwhooker opened this issue Dec 16, 2014 · 1 comment

Comments

@mwhooker
Copy link

I see two issues with supporting this currently

  • No easy way to construct http request with cache parameters
  • poor support for 304 responses

Right now I have to call GetResponseWithHeaders with my own header object. I suppose this is probably fine, but it's a bit of boiler plate code that the library could provide.

If I construct a request with an If-None-Match header and receive a 304 response, GetResponseWithHeaders will return a nil value for the response and an error with the 304 status code. It would be ideal if I had access to the response body so I could inspect resp.StatusCode instead of parsing the error

@korya
Copy link

korya commented Apr 9, 2015

+1.

It does not make sense at all to return an error for non-error HTTP status code; that is, if the status code is 2xx or 3xx, there should be no error, and a caller should get the response object.

Additional problem is that this logic is hidden in a very low level API, doHttpRequest() (https://github.com/AdRoll/goamz/blob/master/s3/s3.go#L1162), making it really hard to find a workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants