mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 06:44:06 +02:00
store relative path URL in resource request on redirect
This commit is contained in:
parent
96672becc6
commit
100ac65975
4 changed files with 8 additions and 1 deletions
|
@ -21,6 +21,8 @@
|
|||
|
||||
#include "ByteRange.h"
|
||||
|
||||
const QString ATP_SCHEME { "atp:" };
|
||||
|
||||
class AssetRequest : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
|
|
@ -91,6 +91,11 @@ void AssetResourceRequest::requestMappingForPath(const AssetPath& path) {
|
|||
|
||||
statTracker->incrementStat(STAT_ATP_MAPPING_REQUEST_SUCCESS);
|
||||
|
||||
// if we got a redirected path we need to store that with the resource request as relative path URL
|
||||
if (request->wasRedirected()) {
|
||||
_relativePathURL = ATP_SCHEME + request->getRedirectedPath();
|
||||
}
|
||||
|
||||
break;
|
||||
default: {
|
||||
switch (request->getError()) {
|
||||
|
|
|
@ -84,6 +84,7 @@ protected:
|
|||
virtual void doSend() = 0;
|
||||
|
||||
QUrl _url;
|
||||
QUrl _relativePathURL;
|
||||
State _state { NotStarted };
|
||||
Result _result;
|
||||
QByteArray _data;
|
||||
|
|
|
@ -55,7 +55,6 @@ void AssetScriptingInterface::setMapping(QString path, QString hash, QScriptValu
|
|||
|
||||
|
||||
void AssetScriptingInterface::downloadData(QString urlString, QScriptValue callback) {
|
||||
const QString ATP_SCHEME { "atp:" };
|
||||
|
||||
if (!urlString.startsWith(ATP_SCHEME)) {
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue