httpx icon indicating copy to clipboard operation
httpx copied to clipboard

✨ obey retry after delay

Open ndaWefox opened this issue 1 year ago • 1 comments
trafficstars

Summary

Obey retry after as defined by the specifications

Checklist

  • [x] I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
  • [x] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • [ ] I've updated the documentation accordingly.

ndaWefox avatar Feb 21 '24 15:02 ndaWefox

This issue was raised on Retry requests.

Proposition was to add a transport layer but it will not suffice, as if the redirection is done by the transport layer, then the history will be lost due to the behavior of Client._send_handling_redirects

ndaWefox avatar Feb 21 '24 16:02 ndaWefox

Ah thanks for getting involved. We'd really need this to be started as a discussion first, tho it is helpful to see how you've resolved it.

Proposition was to add a transport layer but it will not suffice, as if the redirection is done by the transport layer, then the history will be lost due to the behavior of Client._send_handling_redirects

That's interesting... can we instead resolve that issue? Ie... if a transport returns a Response with a non-empty history, then the full history is retained, even when redirects occur?

lovelydinosaur avatar Feb 26 '24 16:02 lovelydinosaur

(I'm going to close this off as a pull request, but very much open to this discussion progressing... I think you've probably identified a valid issue here let's talk it through)

lovelydinosaur avatar Feb 26 '24 16:02 lovelydinosaur