kr / s3

Go package for Amazon’s S3 API
http://godoc.org/github.com/kr/s3
MIT License
107 stars 34 forks source link

Enable signing when request.URL has been manually set #17

Open rafikk opened 11 years ago

rafikk commented 11 years ago

I recently came across an issue with encoding + and ? in the path component of S3 files. See this thread on the mailing list for context: https://groups.google.com/forum/#!topic/golang-nuts/CbL27WPZavY

I could get around the issue by manually setting request.URL on the request object. Doing so doesn't set request.Host which causes signing to fail. This diff pulls the host from request.URL. This is consistent with how the other url portions are accessed, e.g. r.URL.RawQuery.