From 88a3e9c0a3e16fe36778c191713dc014094cc217 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 9 Jan 2021 21:04:18 +0100 Subject: [PATCH] Use symbolic constants for HTTP ports and status codes No real changes, just avoid using raw numbers, which is not very readable, notably for HTTP_STATUS_PROXY_AUTH_REQ which is not really a well-known value. --- src/msw/webrequest_winhttp.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/msw/webrequest_winhttp.cpp b/src/msw/webrequest_winhttp.cpp index c48f88ac06..48e0d130b3 100644 --- a/src/msw/webrequest_winhttp.cpp +++ b/src/msw/webrequest_winhttp.cpp @@ -208,10 +208,10 @@ void wxWebRequestWinHTTP::CreateResponse() return; int status = m_response->GetStatus(); - if ( status == 401 || status == 407) + if ( status == HTTP_STATUS_DENIED || status == HTTP_STATUS_PROXY_AUTH_REQ ) { m_authChallenge.reset(new wxWebAuthChallengeWinHTTP( - (status == 407) ? wxWebAuthChallenge::Source_Proxy : wxWebAuthChallenge::Source_Server, *this)); + status == HTTP_STATUS_PROXY_AUTH_REQ ? wxWebAuthChallenge::Source_Proxy : wxWebAuthChallenge::Source_Server, *this)); if ( m_authChallenge->Init() ) SetState(wxWebRequest::State_Unauthorized, m_response->GetStatusText()); else @@ -243,7 +243,7 @@ void wxWebRequestWinHTTP::Start() int port; if ( !uri.HasPort() ) - port = isSecure ? 443 : 80; + port = isSecure ? INTERNET_DEFAULT_HTTPS_PORT : INTERNET_DEFAULT_HTTP_PORT; else port = wxAtoi(uri.GetPort());