[libcalamares] Avoid deprecation warning in network attributes
This commit is contained in:
parent
f0a25bd397
commit
6ee0da41c8
@ -27,10 +27,16 @@ namespace Network
|
||||
void
|
||||
RequestOptions::applyToRequest( QNetworkRequest* request ) const
|
||||
{
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
|
||||
constexpr const auto RedirectPolicyAttribute = QNetworkRequest::FollowRedirectsAttribute;
|
||||
#else
|
||||
constexpr const auto RedirectPolicyAttribute = QNetworkRequest::RedirectPolicyAttribute;
|
||||
#endif
|
||||
|
||||
if ( m_flags & Flag::FollowRedirect )
|
||||
{
|
||||
// Follows all redirects except unsafe ones (https to http).
|
||||
request->setAttribute( QNetworkRequest::FollowRedirectsAttribute, true );
|
||||
request->setAttribute( RedirectPolicyAttribute, true );
|
||||
}
|
||||
|
||||
if ( m_flags & Flag::FakeUserAgent )
|
||||
|
Loading…
Reference in New Issue
Block a user