Skip to content

Statuses 402, 429, and 451

Compare
Choose a tag to compare
@Cantido Cantido released this 13 Oct 01:46
· 191 commits to master since this release

Added

  • The 402 Payment Required status, along with related callbacks payment_required? and handle_payment_required/1.
  • The 451 Unavailable for Legal Reasons status, along with related callbacks unavailable_for_legal_reasons?/1 and handle_unavailable_for_legal_reasons/1.
  • The 429 Too Many Requests status, along with related callbacks too_many_requests?/1 and handle_too_many_requests/1. If you return a map containing a :retry_after value, Liberator will use that to set a retry-after header.
  • You can also return a :retry_after value from any other decision function, like service_available?/1, or moved_permanently?/1, for the same effect. See MDN's docs on the retry-after header for more information on why you'd want to do this.

Fixed

  • Dates in headers are now parsed properly. (#1)