mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-28 01:45:36 -04:00
[libcalamares] Avoid deprecation warning in network attributes
This commit is contained in:
parent
f0a25bd397
commit
6ee0da41c8
1 changed files with 7 additions and 1 deletions
|
@ -27,10 +27,16 @@ namespace Network
|
||||||
void
|
void
|
||||||
RequestOptions::applyToRequest( QNetworkRequest* request ) const
|
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 )
|
if ( m_flags & Flag::FollowRedirect )
|
||||||
{
|
{
|
||||||
// Follows all redirects except unsafe ones (https to http).
|
// Follows all redirects except unsafe ones (https to http).
|
||||||
request->setAttribute( QNetworkRequest::FollowRedirectsAttribute, true );
|
request->setAttribute( RedirectPolicyAttribute, true );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_flags & Flag::FakeUserAgent )
|
if ( m_flags & Flag::FakeUserAgent )
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue