mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 18:25:33 +08:00
changed to native line ending encoding
This commit is contained in:
@@ -1,31 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
|
||||
namespace OpenSim.Framework.Servers
|
||||
{
|
||||
public class RestStreamHandler : BaseStreamHandler
|
||||
{
|
||||
RestMethod m_restMethod;
|
||||
|
||||
override public byte[] Handle(string path, Stream request )
|
||||
{
|
||||
Encoding encoding = Encoding.UTF8;
|
||||
StreamReader streamReader = new StreamReader(request, encoding);
|
||||
|
||||
string requestBody = streamReader.ReadToEnd();
|
||||
streamReader.Close();
|
||||
|
||||
string param = GetParam(path);
|
||||
string responseString = m_restMethod(requestBody, path, param );
|
||||
|
||||
return Encoding.UTF8.GetBytes(responseString);
|
||||
}
|
||||
|
||||
public RestStreamHandler(string httpMethod, string path, RestMethod restMethod) : base( httpMethod, path )
|
||||
{
|
||||
m_restMethod = restMethod;
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
|
||||
namespace OpenSim.Framework.Servers
|
||||
{
|
||||
public class RestStreamHandler : BaseStreamHandler
|
||||
{
|
||||
RestMethod m_restMethod;
|
||||
|
||||
override public byte[] Handle(string path, Stream request )
|
||||
{
|
||||
Encoding encoding = Encoding.UTF8;
|
||||
StreamReader streamReader = new StreamReader(request, encoding);
|
||||
|
||||
string requestBody = streamReader.ReadToEnd();
|
||||
streamReader.Close();
|
||||
|
||||
string param = GetParam(path);
|
||||
string responseString = m_restMethod(requestBody, path, param );
|
||||
|
||||
return Encoding.UTF8.GetBytes(responseString);
|
||||
}
|
||||
|
||||
public RestStreamHandler(string httpMethod, string path, RestMethod restMethod) : base( httpMethod, path )
|
||||
{
|
||||
m_restMethod = restMethod;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user