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
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.
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
rest_sync_transfer()).rest_get(), etc. specifying whether to follow redirects.CURLOPT_FOLLOWLOCATIONand pass the specified integer value asCURLOPT_MAXREDIRS.Implementation
rest_clientDescribe alternatives you've considered
We considered following redirect ourselves, but
rest_get()does not return the HTTP response headers. It special-casesContent-Typeand pulls that, and only that, out into a separate return pv.