mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 16:36:54 +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"
|
#include "ByteRange.h"
|
||||||
|
|
||||||
|
const QString ATP_SCHEME { "atp:" };
|
||||||
|
|
||||||
class AssetRequest : public QObject {
|
class AssetRequest : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -91,6 +91,11 @@ void AssetResourceRequest::requestMappingForPath(const AssetPath& path) {
|
||||||
|
|
||||||
statTracker->incrementStat(STAT_ATP_MAPPING_REQUEST_SUCCESS);
|
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;
|
break;
|
||||||
default: {
|
default: {
|
||||||
switch (request->getError()) {
|
switch (request->getError()) {
|
||||||
|
|
|
@ -84,6 +84,7 @@ protected:
|
||||||
virtual void doSend() = 0;
|
virtual void doSend() = 0;
|
||||||
|
|
||||||
QUrl _url;
|
QUrl _url;
|
||||||
|
QUrl _relativePathURL;
|
||||||
State _state { NotStarted };
|
State _state { NotStarted };
|
||||||
Result _result;
|
Result _result;
|
||||||
QByteArray _data;
|
QByteArray _data;
|
||||||
|
|
|
@ -55,7 +55,6 @@ void AssetScriptingInterface::setMapping(QString path, QString hash, QScriptValu
|
||||||
|
|
||||||
|
|
||||||
void AssetScriptingInterface::downloadData(QString urlString, QScriptValue callback) {
|
void AssetScriptingInterface::downloadData(QString urlString, QScriptValue callback) {
|
||||||
const QString ATP_SCHEME { "atp:" };
|
|
||||||
|
|
||||||
if (!urlString.startsWith(ATP_SCHEME)) {
|
if (!urlString.startsWith(ATP_SCHEME)) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue