code4lib / ruby-oai

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

OAI resumption initialization does not pass along the initial opts #106

Closed jeremyf closed 1 year ago

jeremyf commented 1 year ago

The OAI::Client#do_resumable method initializes the responseClass with the correct verb and opts (e.g. metadata_prefix of “oai_adl”), however the resumption block does not include those same opts.

Here is the existing code:

def do_resumable(responseClass, verb, opts)
  responseClass.new(do_request(verb, opts)) do |response|
    responseClass.new \
      do_request(verb, :resumption_token => response.resumption_token)
  end
end

It appears that the fix for this code would be:

def do_resumable(responseClass, verb, opts)
  responseClass.new(do_request(verb, opts)) do |response|
    responseClass.new \
      do_request(verb, opts.merge(:resumption_token => response.resumption_token))
  end
end
jeremyf commented 1 year ago

When I add the above code, it raises a different exception that looks like we have a violation of the OAI spec. So I'm closing this issue in favor of a localized solution.