8000 Curl tool not following "retry-after" header for redirect request · Issue #11447 · curl/curl · GitHub
[go: up one dir, main page]

Skip to content

Curl tool not following "retry-after" header for redirect request #11447

@yairlenga

Description

@yairlenga

As per HTTP standard (https://www.rfc-editor.org/rfc/rfc9110#field.retry-after):

Servers send the "Retry-After" header field to indicate how long the user agent ought to wait before making a follow-up request. When sent with a 503 (Service Unavailable) response, Retry-After indicates how long the service is expected to be unavailable to the client. When sent with any 3xx (Redirection) response, Retry-After indicates the minimum time that the user agent is asked to wait before issuing the redirected request.

Currently, curl respect the retry-after only for transient error conditions. Per documentation: Transient error means either: a timeout, an FTP 4xx response code or an HTTP 408, 429, 500, 502, 503 or 504 response code

The specific use case is to allow "curl" to follow "retry-after" when fetching API responses for time-consuming operation. The server can redirect the request to same URL, advertising a time when results may be expected. I'm using CURL to retrieve result for long-running calculation, via REST interface, where the server is using 303 with retry-after to implement retries, with backoff logic, based on the progress of the calculation.

Given that curl automatically respect retry-after for error condition - make sense to have this behavior by default (with command line options to override).

Tested with curl 7.29 - I do not have access to newer curl, but per documentation behavior in 8.X is the same as 7.66, when support was added to follow retry-after for error conditions.

4BC4

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0