code4lib / ruby-oai

a Ruby library for building OAI-PMH clients and servers
MIT License
62 stars 42 forks source link

Allow faraday 2 #89

Closed jrochkind closed 2 years ago

jrochkind commented 2 years ago

Right now our dependency on faraday-middleware means any app using this gem (or another gem that depends on it) cannot update to faraday 2.0, because the faraday-middleware gem is faraday 1.0-only.

As far as i can tell, we use faraday-middleware only for the "follow redirects" middleware. https://github.com/code4lib/ruby-oai/blob/3cdc12d86c7d1dde00b47105a7dab6def3f6801d/lib/oai/client.rb#L97-L99

Updating ruby-oai to require faraday 2.x is likely to be disruptive to current users. We really want it to support 1.x or 2.x.

It's not entirely clear how to use that middleware while working with either faraday 1.x or 2.x

It may require some upstream PR's, looking into it.

https://github.com/lostisland/faraday/discussions/1358#discussioncomment-2452734

jrochkind commented 2 years ago

https://github.com/tisba/faraday-follow-redirects/pull/4

jrochkind commented 2 years ago

Hmm, after switching over to newest version of faraday_follow-redirects gem, we can upgrade to Faraday 2.x... but tests don't actually pass.

We get a <Encoding::CompatibilityError(<incompatible encoding regexp match (ASCII-8BIT regexp with ISO-8859-1 string)>) in one.

I will see if I can find time to try to debug.