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

adding extra headers to S3 PutObject #119

Closed
joeyh opened this Issue Aug 8, 2014 · 5 comments

Comments

Projects
None yet
2 participants
@joeyh
Copy link
Contributor

joeyh commented Aug 8, 2014

The Internet Archive has a S3 service, and it uses a lot of extra headers to add metadata for files uploaded to it. Some of these headers are mandatory. For example, x-archive-meta-mediatype=texts

As far as I can tell, PutObject does not provide a way to add such additional headers.
poMetadata is very close, except it has x-amz-meta- prepended to the field names.

I propose a new field, poOtherHeaders :: [(Text,Text)] , which is concated with s3QOtherHeaders

@joeyh

This comment has been minimized.

Copy link
Contributor Author

joeyh commented Aug 9, 2014

Turns out IA's S3 deals with this by accepting x-amz-meta-* as aliases for x-archive-meta-*

However, there's a x-archive-auto-make-bucket/x-amz-auto-make-bucket header that needs to be sent, and the PutObject API does not allow that. So poOtherHeaders is still needed.

@joeyh joeyh referenced this issue Aug 9, 2014

Merged

add poOtherHeaders #120

@mxswd

This comment has been minimized.

Copy link
Contributor

mxswd commented Aug 9, 2014

What happens if such a header is set and pushed to AWS s3? Does s3 reject it because of an unknown header or does s3 silently ignore the header? If it silently ignores the header, we should probably do something else to ensure users don't lose information.

@joeyh

This comment has been minimized.

Copy link
Contributor Author

joeyh commented Aug 9, 2014

Maxwell Swadling wrote:

What happens if such a header is set and pushed to AWS s3? Does s3 reject it
because of an unknown header or does s3 silently ignore the header? If it
silently ignores the header, we should probably do something else to ensure
users don't lose information.

S3 ignores the x-amz-auto-make-bucket header, and presumably ignores
other unrecognised headers too.

See 7841398 for a different approach
that avoids the possibility of silent data loss.

see shy jo

@mxswd

This comment has been minimized.

Copy link
Contributor

mxswd commented Aug 9, 2014

Thanks @joeyh.

I would much rather this. Silent data loss is scary.

I'm happy with the PR. 👍

@joeyh

This comment has been minimized.

Copy link
Contributor Author

joeyh commented Aug 9, 2014

Maxwell Swadling wrote:

Thanks @joeyh.

I would much rather this. Silent data loss is scary.

I'm happy with the PR. 👍

I've updated the PR with an updated example program using the feature.

It would be great if this could be released to hackage soonish!

see shy jo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.