realXtend / tundra

realXtend Tundra SDK, a 3D virtual world application platform.
www.realxtend.org
Apache License 2.0
84 stars 70 forks source link

Trailing slash appended when requiring assets with get parameters #743

Closed syymza closed 10 years ago

syymza commented 10 years ago

When using asset.RequestAsset() for an external resource with an URL containing a get paramether, a trailing slash is added to the url.

Example:

var transfer = asset.RequestAsset("http://myservice.com/?active", "Binary", true); 

creates a GET request to http://myservice.com/?active/

jonnenauha commented 10 years ago

We talked a bit on IRC already. To me it seems that AssetAPI::RequestAsset() does not modify the ref. I suspect the culprit is HttpAssetProvider::RequestAsset that runs

QString assetRefWithoutSubAssetName;
AssetAPI::AssetRefType refType = AssetAPI::ParseAssetRef(assetRef, 0, 0, 0, 0, 0, 0, 0, 0, 0, &assetRefWithoutSubAssetName);
assetRef = assetRefWithoutSubAssetName;

This ref does not have a subasset but it might inject the trailing slash somewhere in there. To start debugging this i suggest putting prints there for assetRef before and after that parse call. Then fixing ParseAssetRef if needed, although there you need to be pretty careful touching anything :) But it would be nice that query prams could be used via AssetAPI correctly. So we need to fix this...

jonnenauha commented 10 years ago

Fixed in https://github.com/Adminotech/tundra/commit/592e6704f30941920b7f192438226a26cf6b8a50 forgot to make the issue ref in the commit message :P

jonnenauha commented 10 years ago

I'll actually close this as the ref is missing, so when tundra2 pulls it in this wont be automatically closed. Will be in next Rocket release and sent to rex/tundra2 in the upcoming weeks.