let StreamReader be in using statements

This commit is contained in:
UbitUmarov
2017-05-07 00:47:45 +01:00
parent de55ad9545
commit d0912b6151
22 changed files with 81 additions and 88 deletions

View File

@@ -50,11 +50,10 @@ namespace OpenSim.Framework.Servers.HttpServer
protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
string requestBody;
Encoding encoding = Encoding.UTF8;
StreamReader streamReader = new StreamReader(request, encoding);
string requestBody = streamReader.ReadToEnd();
streamReader.Close();
using(StreamReader streamReader = new StreamReader(request,encoding))
requestBody = streamReader.ReadToEnd();
string param = GetParam(path);
string responseString = m_restMethod(requestBody, path, param, httpRequest, httpResponse);