Skip to content

[FEATURE] rest_client should follow redirects #3950

Description

@rlaager

Is your feature request related to a problem? Please describe.
rest_client (e.g. rest_get()) does not follow HTTP redirects. We ran into this when trying to validate STIR/SHAKEN Identity headers.

Describe the solution you'd like

  • The easiest solution would be to unconditionally set CURLOPT_FOLLOWLOCATION in rest_client (probably in rest_sync_transfer()).
  • The most flexible would be to allow the caller to optionally pass a boolean to rest_get(), etc. specifying whether to follow redirects.
    • Or, instead of a boolean, allow the caller to pass an integer of how many redirects to follow, defaulting to zero (to preserve the existing behavior). If non-zero, set CURLOPT_FOLLOWLOCATION and pass the specified integer value as CURLOPT_MAXREDIRS.

Implementation

  • Component: rest_client

Describe alternatives you've considered
We considered following redirect ourselves, but rest_get() does not return the HTTP response headers. It special-cases Content-Type and pulls that, and only that, out into a separate return pv.

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions