Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
8a861658
Commit
8a861658
authored
Jul 28, 2015
by
Zach H
Browse files
allow URL redirects
parent
183fbd28
Changes
1
Show whitespace changes
Inline
Side-by-side
cockatrice/src/carddatabase.cpp
View file @
8a861658
...
@@ -448,6 +448,15 @@ void PictureLoader::picDownloadFinished(QNetworkReply *reply)
...
@@ -448,6 +448,15 @@ void PictureLoader::picDownloadFinished(QNetworkReply *reply)
qDebug
()
<<
"Download failed:"
<<
reply
->
errorString
();
qDebug
()
<<
"Download failed:"
<<
reply
->
errorString
();
}
}
int
statusCode
=
reply
->
attribute
(
QNetworkRequest
::
HttpStatusCodeAttribute
).
toInt
();
if
(
statusCode
==
301
||
statusCode
==
302
)
{
QUrl
redirectUrl
=
reply
->
attribute
(
QNetworkRequest
::
RedirectionTargetAttribute
).
toUrl
();
QNetworkRequest
req
(
redirectUrl
);
qDebug
()
<<
"following redirect:"
<<
cardBeingDownloaded
.
getCard
()
->
getName
()
<<
"Url:"
<<
req
.
url
();
networkManager
->
get
(
req
);
return
;
}
const
QByteArray
&
picData
=
reply
->
peek
(
reply
->
size
());
//peek is used to keep the data in the buffer for use by QImageReader
const
QByteArray
&
picData
=
reply
->
peek
(
reply
->
size
());
//peek is used to keep the data in the buffer for use by QImageReader
// check if the image is blacklisted
// check if the image is blacklisted
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment