Open tapanij opened 11 years ago
Hmm, I don't think we add that slash automatically. Qt might if it thinks its a directory?
This logic might actually append the last /
if it thinks its a folder. Would need to look closer to be sure https://github.com/realXtend/naali/blob/tundra2/src/Core/AssetModule/HttpAssetProvider.cpp?source=c#L131-L139
Imo that logic should be removed as IAsset::RequestAsset and IAssetBundle takes care of that no refs that has subassetref will be requested directly from the providers!
AssetAPI::ParseAssetRef has this:
QString path = GuaranteeTrailingSlash(fullPathRef.left(directorySeparatorIndex+1).trimmed());
.. protocol_path += path; .. if (outFullRefNoSubAssetName) *outFullRefNoSubAssetName = GuaranteeTrailingSlash(protocol_path) + assetFilename;
and HttpAssetProvider is using the param called (on that side) &assetRefWithoutSubAssetName...
Also the "www." hack and the "\" -> "/" replacement look a little iffy to me since they cause asset refs to be interpreted differently in different contexts. Could be used to get around script based whitelisting etc.
Get JSON from the github api: RequestAsset("https://api.github.com/repos/mojombo/jekyll/issues", "Binary");
ERROR: Error: Transfer of asset "Binary", name "https://api.github.com/repos/mojombo/jekyll/issues" failed! Reason: "Http GET for address "https://api.github.com/repos/mojombo/jekyll/issues/" returned an error: Error downloading https://api.github.com/repos/mojombo/jekyll/issues/ - server replied: Not Found"
CAUSE: Slash is added to end of the URL automatically. Because of this github api couldn't find the JSON file.
WORKAROUND: Add question mark to the end of the URL: RequestAsset("https://api.github.com/repos/mojombo/jekyll/issues?", "Binary");