diff options
Diffstat (limited to 'OpenSim/Server')
-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 | } |