mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-10-19 11:19:36 +00:00
A cross-host redirect is followed by a new client, which did not get the payload limit, the max timeout, the connection timeout's microseconds or the hostname address map. Over HTTPS it also lost the session verifier, the server certificate verifier and a store given to set_ca_cert_store(), and fell back to the default CAs. Copy them over. The store belongs to the original TLS context, so pass on the CA certificates it holds as PEM. After the redirect, the original client also answered a 401 or 407 from the new host with its own digest credentials and sent that to its own host, with the new host's path. Return the redirected response as it is, since the client that followed it has already answered what it could.