-
Notifications
You must be signed in to change notification settings - Fork 146
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
Double-splat (**options) operator fails on hash with string keys in put_object() call #535
Comments
This was introduced due to Ruby 2.7/3.0 kwargs update, which doesn't work the same way, sadly (as I see you're reproducing on 2.6.6). @jywarren looking into it - can you check if chucking on a If it does I'll roll out a test version you can try. |
Ahh, hmm. That didn't seem to, was i doing it right?:
Thank you for writing back! Is the double-splat completely necessary? It seems to be caught by the default arg set in:
Much appreciated! |
@jywarren Gah, my bad - forgot it's a rails method.
|
And to clarify why I'm asking - I don't have a paperclip test app at the moment so I want to make sure this doesn't break further up the stack somewhere in your app. |
Looks good! Thanks! We skipped |
This issue has been marked inactive and will be closed if no further activity occurs. |
I'm also encountering this same issue. #551 |
The string keys in question are added by fog-google itself. From the def save(options = {})
requires :body, :directory, :key
if options != {}
Fog::Logger.deprecation("options param is deprecated, use acl= instead [light_black](#{caller.first})[/]")
end
options["x-goog-acl"] ||= @acl if @acl
options["Cache-Control"] = cache_control if cache_control
options["Content-Disposition"] = content_disposition if content_disposition
options["Content-Encoding"] = content_encoding if content_encoding
options["Content-MD5"] = content_md5 if content_md5
options["Content-Type"] = content_type if content_type
options["Expires"] = expires if expires
options.merge!(metadata)
data = service.put_object(directory.key, key, body, **options)
merge_attributes(data.headers.reject { |key, _value| ["Content-Length", "Content-Type"].include?(key) })
self.content_length = Fog::Storage.get_body_size(body)
self.content_type ||= Fog::Storage.get_content_type(body)
true
end Note the string keys added to the data = service.put_object(directory.key, key, body, options) Then that would solve the issue. Note that fog-google says it supports Ruby 2.0+, which is perfectly OK. Still, because of this issue, it stopped working on Ruby 2.5 or earlier starting with the 1.14.0 version. With this problem fixed, you could restore that support. |
We're seeing an error
hash key "x-goog-acl" is not a Symbol
inv1.15.0
(link to our PR):https://sentry.io/share/issue/6fb1fbdfa23f417192acba7c65747e95/
It's related to the introduction of the
**
"double splat" operator to this line 2 months ago in #523:fog-google/lib/fog/storage/google_xml/requests/put_object.rb
Line 25 in 0411601
I believe it's redundant, in any case, since there's a default set in the function definition:
fog-google/lib/fog/storage/google_xml/requests/put_object.rb
Line 25 in 0411601
You can reproduce this behavior in the console with the same error occurring, just with dummy hashes:
Thanks for the fog library, we really appreciate your hard work on it!!!!
The text was updated successfully, but these errors were encountered: