store relative path URL in resource request on redirect

This commit is contained in:
Stephen Birarda 2017-08-15 15:27:44 -07:00
parent 96672becc6
commit 100ac65975
4 changed files with 8 additions and 1 deletions

View file

@ -21,6 +21,8 @@
#include "ByteRange.h"
const QString ATP_SCHEME { "atp:" };
class AssetRequest : public QObject {
Q_OBJECT
public:

View file

@ -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()) {

View file

@ -84,6 +84,7 @@ protected:
virtual void doSend() = 0;
QUrl _url;
QUrl _relativePathURL;
State _state { NotStarted };
Result _result;
QByteArray _data;

View file

@ -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;