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.
parent
a2d51f0ff4
commit
35d29ef3e3
|
@ -408,8 +408,18 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
|
||||||
{
|
{
|
||||||
HttpWebResponse webRsp = (HttpWebResponse)((WebException)e).Response;
|
HttpWebResponse webRsp = (HttpWebResponse)((WebException)e).Response;
|
||||||
Status = (int)webRsp.StatusCode;
|
Status = (int)webRsp.StatusCode;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (Stream responseStream = webRsp.GetResponseStream())
|
||||||
|
{
|
||||||
|
ResponseBody = responseStream.GetStreamString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
ResponseBody = webRsp.StatusDescription;
|
ResponseBody = webRsp.StatusDescription;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Status = (int)OSHttpStatusCode.ClientErrorJoker;
|
Status = (int)OSHttpStatusCode.ClientErrorJoker;
|
||||||
|
|
Loading…
Reference in New Issue