static bool IsDefaultPort(const URI& uri) { switch(uri.GetPort()) { case 80: return uri.GetScheme() == Scheme::HTTP; case 443: return uri.GetScheme() == Scheme::HTTPS; default: return false; } }
StandardHttpRequest::StandardHttpRequest(const URI& uri, HttpMethod method) : HttpRequest(uri, method), bodyStream(nullptr), m_responseStreamFactory() { if(IsDefaultPort(uri)) { StandardHttpRequest::SetHeaderValue(HOST_HEADER, uri.GetAuthority()); } else { Aws::StringStream host; host << uri.GetAuthority() << ":" << uri.GetPort(); StandardHttpRequest::SetHeaderValue(HOST_HEADER, host.str()); } }