Comments (1)
I am interested in this feature, i need to change the content type and content encoding. I have been playing with GetResponseHeader from the original goaws/goaws lib, porting this function to this lib...
got this so far:
s3.go
func (b *Bucket) GetResponseWithHeaders(path string, headers map[string][]string) (data []byte, err error) {
req := &request{
bucket: b.Name,
path: path,
headers: headers,
}
fmt.Printf("**** initial headers: %v\n\n\n", req)
err = b.S3.prepare(req)
fmt.Printf("**** headers after prep: %v\n\n\n\n", req)
if err != nil {
return nil, err
}
for attempt := b.S3.AttemptStrategy.Start(); attempt.Next(); {
resp, err := b.S3.run(req, nil)
if shouldRetry(err) && attempt.HasNext() {
continue
}
if err != nil {
return nil, err
}
fmt.Printf("**** headers after get: %v\n\n\n", resp.Header)
data, err = ioutil.ReadAll(resp.Body)
resp.Body.Close()
return data, nil
}
panic("unreachable")
}
also added to S3 struct
aws.AttemptStrategy
this works, pulls back the data, how ever the headers do not seem to be sticking, on printing the headers, the last one shows the content type of the actual file being downloaded, not the one set...
still working on this.
from goamz.
Related Issues (20)
- Throwing away original error messages
- IAM role credentials support HOT 1
- Unstable "No valid AWS authentication found" error using IAM roles
- Create RDS db snapshot feature
- s3 partial get HOT 3
- Expose ec2test package
- When running concurrently, s3testserver never unlocks mutex
- Get https:/bucket/file: net/http: TLS handshake timeout HOT 4
- The aws http client doesn't seem to be working very well with the S3 client on retry
- DynamoDB support
- Make MaxTries configurable
- ec2.CreateImage with NoDevice return InvalidBlockDeviceMapping
- AWS_ACCESS_KEY should be optional
- Add a note that this is not supported anymore HOT 4
- PutPart returning wrong size
- Trying to add a method to initiate a glacier restore, getting an incorrect signature
- S3 versioning
- ceph s3 compatible api, multipart complete fail
- it seems that Multi.PutPart won't close the response body and it will lead resource leak.
- change s3key acl
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from goamz.