aristidb / aws

Amazon Web Services for Haskell
BSD 3-Clause "New" or "Revised" License
238 stars 107 forks source link

unable to specify User-Agent #286

Open joeyh opened 1 year ago

joeyh commented 1 year ago

I've had a request from a user that git-annex send its User-Agent when using S3, and it seems that it is not possible to do that using this library.

There is poMetadata, but all headers in it get "x-amz-meta-" prepended to them. And GetObject does not allow any headers to be sent, nor does PutBucket, etc.

I'm reminded of https://github.com/aristidb/aws/issues/119 where I tried to add a poOtherHeaders that could contain arbitrary headers, but that was rejected in review. If that was the right decision then, it seems that every S3 request (and possibly others) would need to be changed to add a way to specify the User-Agent. On the other hand, it does occur to me that another way to support it would be to allow the user to provide a Request -> Request function to aws. And then the user could provide that or whatever other headers. I don't know if adding headers can break request signing?