-
Notifications
You must be signed in to change notification settings - Fork 57
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
Excon::Errors::Forbidden with files containing Umlauts #6
Comments
For now I've monkey-patched dragonfly-s3_data_store to escape utf8 in json, which does the trick: module Dragonfly
class S3DataStore
def meta_to_headers(meta)
{'x-amz-meta-json' => JSON.generate(meta, ascii_only: true)}
end
end
end The default implementation uses I've opened an issue for fog at fog/fog#2942. |
Hi guys, just chiming in, because I ran into this problem as well. IMHO this really needs to be fixed in We decided to monkey patch this in our module Dragonfly
module S3DataStoreUmlauts
def meta_to_headers(meta)
{ 'x-amz-meta-json' => ActiveSupport::JSON.encode(meta) }
end
end
end which we then use to Dragonfly.app.datastore.extend Dragonfly::S3DataStoreUmlauts PS: |
Due to another signing error, when the filename contains multiple spaces I'm now using this: module Dragonfly
class S3DataStore
def meta_to_headers(meta)
{'x-amz-meta-json' => JSON.generate(meta, ascii_only: true).gsub(' ', '\u0020')}
end
end
end |
@markevans Maybe dragonfly should simply base64 encode the json? There are so many cases where the generated headers can break either RFC2616 Section 4.2 or S3's buggy interpretation of those rules. |
Oops, deleted last comment which should've landed on a fog/fog-aws#160 ticket. |
Uploading files to S3 fails if the file has an umlaut in its name.
uri encode the filename before storing works:
The text was updated successfully, but these errors were encountered: