diff options
author | Melanie Thielker | 2009-07-07 17:45:02 +0000 |
---|---|---|
committer | Melanie Thielker | 2009-07-07 17:45:02 +0000 |
commit | fe1e9ac5c3b860be4b7dcba42b95970ba5dbbe5e (patch) | |
tree | 7a0511b983e4db1aa27fdcbccb55a9c8bf1821a7 /OpenSim | |
parent | Removing the left over monolithic user server config files (diff) | |
download | opensim-SC_OLD-fe1e9ac5c3b860be4b7dcba42b95970ba5dbbe5e.zip opensim-SC_OLD-fe1e9ac5c3b860be4b7dcba42b95970ba5dbbe5e.tar.gz opensim-SC_OLD-fe1e9ac5c3b860be4b7dcba42b95970ba5dbbe5e.tar.bz2 opensim-SC_OLD-fe1e9ac5c3b860be4b7dcba42b95970ba5dbbe5e.tar.xz |
Make the asset IN connector return HTTP 404 if an asset is not found, and
also make it return a non-xml content type so a browser can be used
for testing it.
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs b/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs index 7e650f0..fe0da0b 100644 --- a/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs +++ b/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs | |||
@@ -68,10 +68,16 @@ namespace OpenSim.Server.Handlers.Asset | |||
68 | { | 68 | { |
69 | result = m_AssetService.GetData(p[0]); | 69 | result = m_AssetService.GetData(p[0]); |
70 | if (result == null) | 70 | if (result == null) |
71 | { | ||
72 | httpResponse.StatusCode = (int)HttpStatusCode.NotFound; | ||
73 | httpResponse.ContentType = "text/plain"; | ||
71 | result = new byte[0]; | 74 | result = new byte[0]; |
72 | 75 | } | |
73 | httpResponse.StatusCode = (int)HttpStatusCode.OK; | 76 | else |
74 | httpResponse.ContentType = "application/octet-stream"; | 77 | { |
78 | httpResponse.StatusCode = (int)HttpStatusCode.OK; | ||
79 | httpResponse.ContentType = "application/octet-stream"; | ||
80 | } | ||
75 | } | 81 | } |
76 | else if (p.Length > 1 && p[1] == "metadata") | 82 | else if (p.Length > 1 && p[1] == "metadata") |
77 | { | 83 | { |
@@ -87,6 +93,12 @@ namespace OpenSim.Server.Handlers.Asset | |||
87 | httpResponse.ContentType = | 93 | httpResponse.ContentType = |
88 | ServerUtils.SLAssetTypeToContentType(metadata.Type); | 94 | ServerUtils.SLAssetTypeToContentType(metadata.Type); |
89 | } | 95 | } |
96 | else | ||
97 | { | ||
98 | httpResponse.StatusCode = (int)HttpStatusCode.NotFound; | ||
99 | httpResponse.ContentType = "text/plain"; | ||
100 | result = new byte[0]; | ||
101 | } | ||
90 | } | 102 | } |
91 | else | 103 | else |
92 | { | 104 | { |
@@ -101,6 +113,12 @@ namespace OpenSim.Server.Handlers.Asset | |||
101 | httpResponse.ContentType = | 113 | httpResponse.ContentType = |
102 | ServerUtils.SLAssetTypeToContentType(asset.Type); | 114 | ServerUtils.SLAssetTypeToContentType(asset.Type); |
103 | } | 115 | } |
116 | else | ||
117 | { | ||
118 | httpResponse.StatusCode = (int)HttpStatusCode.NotFound; | ||
119 | httpResponse.ContentType = "text/plain"; | ||
120 | result = new byte[0]; | ||
121 | } | ||
104 | } | 122 | } |
105 | return result; | 123 | return result; |
106 | } | 124 | } |