Skip to content

Conversation

@takuminmin-m
Copy link

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!

end

@@schemes['DATA'] = Data
scheme_list['DATA'] = Data

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

Copy link

@olleolleolle olleolleolle Aug 4, 2022

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)

mamhoff added a commit to friendlycart/friendly_shipping that referenced this pull request Sep 15, 2022
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
end

@@schemes['DATA'] = Data
scheme_list['DATA'] = Data
Copy link

@haseebeqx haseebeqx Jan 9, 2023

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

@PikachuEXE
Copy link

Should we ping contributors individually to see if this can be merged? Or even if this gem is maintained?

@PikachuEXE
Copy link

@dball ?

@PikachuEXE
Copy link

@dball

A fix for a CVE is released

CVE-2023-36617: ReDoS vulnerability in URI

Eventually uri 0.10.x will become unmaintained and this should be addressed soon
Add people as maintainers if you don't the capacity to maintain

@niyando
Copy link

niyando commented May 20, 2024

Can we please get this merged?

@PikachuEXE
Copy link

Released a beta
https://rubygems.org/gems/data_uri_revived/versions/0.1.1.beta2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants