You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently HTTP clients using cpprest SDK perform 2 HTTP requests when retrieving URLs requiring authentication when using WinHTTP-based implementation under Windows: the first one without any auth info, resulting in 401 response, and the second one with the auth info, (hopefully) resulting in 200. This is not catastrophic but a bit annoying, especially when the program knows in advance that it does need authentication and also because this does not happen under Linux with the ASIO-based, where generate_basic_auth_header() is always called if credentials are specified.
This is clearly not done intentionally in WinHTTP code in order to select the most suitable auth scheme in ChooseAuthScheme() and I'm not going to argue with this decision. However I think that adding some http_client_config::use_basic_auth(bool) would be useful in order to at least allow opting in into Linux/ASIO-like behaviour. What do you think about this and would a PR adding such method be accepted?
Note that this issue is in some sense more general than #2, as it's about all requests, not only those using proxies, but in some sense less general than it too, as I'm only interested in (optionally) having the same behaviour with WinHTTP as with ASIO and not allow preselecting any auth scheme as seems to be the case there.
The text was updated successfully, but these errors were encountered:
Currently HTTP clients using cpprest SDK perform 2 HTTP requests when retrieving URLs requiring authentication when using WinHTTP-based implementation under Windows: the first one without any auth info, resulting in 401 response, and the second one with the auth info, (hopefully) resulting in 200. This is not catastrophic but a bit annoying, especially when the program knows in advance that it does need authentication and also because this does not happen under Linux with the ASIO-based, where
generate_basic_auth_header()
is always called if credentials are specified.This is clearly not done intentionally in WinHTTP code in order to select the most suitable auth scheme in
ChooseAuthScheme()
and I'm not going to argue with this decision. However I think that adding somehttp_client_config::use_basic_auth(bool)
would be useful in order to at least allow opting in into Linux/ASIO-like behaviour. What do you think about this and would a PR adding such method be accepted?Note that this issue is in some sense more general than #2, as it's about all requests, not only those using proxies, but in some sense less general than it too, as I'm only interested in (optionally) having the same behaviour with WinHTTP as with ASIO and not allow preselecting any auth scheme as seems to be the case there.
The text was updated successfully, but these errors were encountered: