Skip to content

Conversation

@rustygeldmacher
Copy link

Without requiring 'date', we get an exception in the retry middleware
when it tries to use DateTime for handling the Retry-After header.

Description

This simple script can be used to reproduce the bug:

#!/usr/bin/env ruby

require 'faraday'

conn = Faraday.new('https://amazon.com') do |f|
  f.request :retry, {
    retry_statuses: [301],
    max: 1,
    interval: 1.0,
    backoff_factor: 2
  }
end

conn.get('gp/css/order-history')

The fix is to simply add a require for Ruby's date library so we don't get an exception during retries.

I'm not certain this warrants a spec change (or if that'd even be possible?) but please let me know!

Without requiring 'date', we get an exception in the retry middleware
when it tries to use DateTime for handling the Retry-After header.
Copy link
Member

@olleolleolle olleolleolle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the repair!

@rustygeldmacher Awesome!

Copy link
Member

@olleolleolle olleolleolle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, @rustygeldmacher - thanks!

@olleolleolle olleolleolle merged commit 8c746f6 into lostisland:master Nov 13, 2020
@iMacTia
Copy link
Member

iMacTia commented Nov 13, 2020

OMG just realised this was already fixed in #844 but only in 0.1x because of the mess we were in at the time to get v1.0 done 🙈
Thanks @rustygeldmacher 🎉

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.

3 participants