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,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
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue