From 3257f4d5d21116e9fb8e08f3277b3521d38bc11c Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 6 Sep 2012 17:31:41 +0200 Subject: Revert "Change string concatenation to Path.Combine to eliminate extra slashes." This reverts commit b9d026666dbabb210cc013d29eb79fe214594dd9. --- .../Services/Connectors/Asset/AssetServicesConnector.cs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs index 2a3dacc..45ebf3a 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs @@ -181,7 +181,7 @@ namespace OpenSim.Services.Connectors public AssetBase Get(string id) { - string uri = Path.Combine(MapServer(id), Path.Combine("assets", id)); + string uri = MapServer(id) + "/assets/" + id; AssetBase asset = null; if (m_Cache != null) @@ -218,7 +218,7 @@ namespace OpenSim.Services.Connectors return fullAsset.Metadata; } - string uri = Path.Combine(MapServer(id), Path.Combine("assets", id)); + string uri = MapServer(id) + "/assets/" + id + "/metadata"; AssetMetadata asset = SynchronousRestObjectRequester. MakeRequest("GET", uri, 0); @@ -260,7 +260,7 @@ namespace OpenSim.Services.Connectors public bool Get(string id, Object sender, AssetRetrieved handler) { - string uri = Path.Combine(MapServer(id), Path.Combine("assets", id)); + string uri = MapServer(id) + "/assets/" + id; AssetBase asset = null; if (m_Cache != null) @@ -379,9 +379,7 @@ namespace OpenSim.Services.Connectors return asset.ID; } - string uri = Path.Combine(MapServer(asset.FullID.ToString()), "/assets/"); - if (!uri.EndsWith("/")) - uri += "/"; + string uri = MapServer(asset.FullID.ToString()) + "/assets/"; string newID = string.Empty; try @@ -458,7 +456,7 @@ namespace OpenSim.Services.Connectors } asset.Data = data; - string uri = Path.Combine(MapServer(id), Path.Combine("assets", id)); + string uri = MapServer(id) + "/assets/" + id; if (SynchronousRestObjectRequester. MakeRequest("POST", uri, asset)) @@ -473,7 +471,7 @@ namespace OpenSim.Services.Connectors public bool Delete(string id) { - string uri = Path.Combine(MapServer(id), Path.Combine("assets", id)); + string uri = MapServer(id) + "/assets/" + id; if (SynchronousRestObjectRequester. MakeRequest("DELETE", uri, 0)) -- cgit v1.1 From ac6448810e999c4c0c0035fff43b45db9a094094 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 6 Sep 2012 17:39:30 +0200 Subject: Prevent double slashes, try #3 --- OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs index 45ebf3a..091e41a 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs @@ -126,6 +126,9 @@ namespace OpenSim.Services.Connectors // m_log.DebugFormat("[ASSET]: Using {0} for host name for prefix {1}", host, prefix); + string ret = serverUri.Uri.AbsoluteUri; + if (ret.EndsWith("/")) + ret = ret.Substring(0, ret.Length - 1); return serverUri.Uri.AbsoluteUri; } -- cgit v1.1