mirror of
https://github.com/opensim/opensim.git
synced 2026-06-21 04:55:37 +08:00
If llHTTPRequest results in an error, still attempt to get the response text. If we can't (which implies the server is unreachable), return the StatusDescription as before.
This commit is contained in:
@@ -408,7 +408,17 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
|
||||
{
|
||||
HttpWebResponse webRsp = (HttpWebResponse)((WebException)e).Response;
|
||||
Status = (int)webRsp.StatusCode;
|
||||
ResponseBody = webRsp.StatusDescription;
|
||||
try
|
||||
{
|
||||
using (Stream responseStream = webRsp.GetResponseStream())
|
||||
{
|
||||
ResponseBody = responseStream.GetStreamString();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
ResponseBody = webRsp.StatusDescription;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user