-
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
Keep this gem available with Ruby 3.1 #10
base: master
Are you sure you want to change the base?
Conversation
@@ -61,6 +61,6 @@ def self.build(arg) | |||
end | |||
end | |||
|
|||
@@schemes['DATA'] = Data | |||
scheme_list['DATA'] = Data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps this new improvement could also be used?
ruby/uri@4346daa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made a Rails initializer with this content, which worked for me:
require 'data_uri'
require 'data_uri/open_uri'
URI.register_scheme('DATA', URI::Data)
The URI gem has changed its public API with this version, breaking compatibility with the largely unmaintained `data_uri` gem. This fixes the co-dependency issue for now; once this PR in `data_uri` is merged we can update to the newest `uri` gem: dball/data_uri#10
@@ -61,6 +61,6 @@ def self.build(arg) | |||
end | |||
end | |||
|
|||
@@schemes['DATA'] = Data | |||
scheme_list['DATA'] = Data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend to do this to make it available for older versions of ruby. also used https://ruby-doc.org/stdlib-3.1.0/libdoc/uri/rdoc/URI.html#method-c-register_scheme
unless defined?(self.register_scheme)
def self.register_scheme(scheme, klass)
@@schemes[scheme] = klass
end
end
register_scheme 'DATA', Data
Should we ping contributors individually to see if this can be merged? Or even if this gem is maintained? |
@dball ? |
A fix for a CVE is released CVE-2023-36617: ReDoS vulnerability in URI Eventually |
Can we please get this merged? |
Released a beta |
Hi there,
Thanks for this nice gem to use carrierwave-data-uri.
I noticed
require "data_uri"
fails when I upgraded my application to Ruby3.1.Look like we mustn't use
@@schemes
class variable because the suparclass "URI::Generic" has been changed the specification.(the relevant PR is here).If you have any advices, please tell me.
Hope that helps!