mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-10-29 13:33:40 +00:00
open_stream(), and with it stream::Get() and SSEClient, wrote its own request head and left out what a buffered request gets: the Authorization from set_basic_auth() or set_bearer_token_auth(), and through a plain HTTP proxy the absolute-form target (RFC 9112 3.2.2) and Proxy-Authorization. A proxy refused such a request, and an origin that needs credentials answered 401. Move the two decisions out of write_request() and handle_request() into add_credential_headers() and proxy_target_prefix(), and use them in open_stream() too, after connecting as a buffered request does. A Digest challenge or a redirect is still handed to the caller.
11 KiB
11 KiB