Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expose redirect policy in Download #6271

Open
victor-shepardson opened this issue Apr 24, 2024 · 2 comments
Open

expose redirect policy in Download #6271

victor-shepardson opened this issue Apr 24, 2024 · 2 comments

Comments

@victor-shepardson
Copy link

Motivation

Download doesn't follow redirects, so urls which work in a browser or with curl -L download as 0 bytes. In particular this affects downloads from github release pages.

Description of Proposed Feature

it looks straightforward to change the redirect policy in Qt: https://doc.qt.io/qt-6/qnetworkrequest.html#RedirectPolicy-enum

Could the Download class expose this option around here?

QUrl url = QUrl::fromEncoded(this->m_target.toLocal8Bit());
QNetworkRequest request;
request.setUrl(url);
m_reply = m_manager->get(request);

@muellmusik
Copy link
Contributor

Sounds reasonable. Would you propose setting 2 or 3 with a handler function?

Would you be comfortable creating a PR for this?

@victor-shepardson
Copy link
Author

On second thought I wonder if it's worthwhile to expose the option, or if just setting it to 1 might be sufficient? This is apparently the default in Qt 6, but 0 is the default in Qt 5. Is any good reason for it to be 0 by default, or any reason to set it to 2?

https://doc.qt.io/qt-6/network-changes-qt6.html#redirect-policies

Happy to make PR when I find time, but I don't have a dev environment for SC set up at the moment. Maybe it's trivial for someone else in the meantime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants