Skip to content

Commit

Permalink
rename HTTP.Response -> HTTP.ServerResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
alec1o committed Jun 18, 2024
1 parent 14fd49b commit 2d9adf1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/http/partials/Server/HTTP.Request.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ namespace Netly
{
public partial class HTTP
{
internal class Request : IHTTP.Request
internal class ServerRequest : IHTTP.Request
{
internal Request(HttpListenerRequest request)
internal ServerRequest(HttpListenerRequest request)
{
{
Headers = new Dictionary<string, string>();
Expand Down Expand Up @@ -70,7 +70,7 @@ internal Request(HttpListenerRequest request)
}
}

internal Request(ClientWebSocket ws, Uri uri, Dictionary<string, string> headers)
internal ServerRequest(ClientWebSocket ws, Uri uri, Dictionary<string, string> headers)
{
// websocket client side

Expand Down Expand Up @@ -134,7 +134,7 @@ internal Request(ClientWebSocket ws, Uri uri, Dictionary<string, string> headers
}
}

internal Request(HttpResponseMessage message)
internal ServerRequest(HttpResponseMessage message)
{
var uri = message.RequestMessage.RequestUri;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private void Write(int statusCode, byte[] buffer, Encoding encoding)
catch (Exception e)
{
// TODO: Handle it
Console.WriteLine($"{nameof(Request)} -> {nameof(Send)}: {e}");
Console.WriteLine($"{nameof(ServerRequest)} -> {nameof(Send)}: {e}");
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/http/partials/Server/HTTP.ServerTo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ private async Task HandleConnection(HttpListenerContext context)
{
NetlyEnvironment.Logger.Create("Request processing.");

var request = new Request(context.Request);
var request = new ServerRequest(context.Request);
var response = new ServerResponse(context.Response);
var notFoundMessage = DefaultHtmlBody($"[{request.Method.Method.ToUpper()}] {request.Path}");

Expand Down
2 changes: 1 addition & 1 deletion src/http/partials/Websocket/HTTP.WebSocketTo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public Task Open(Uri host)

await ws.ConnectAsync(host, CancellationToken.None);

MyRequest = new Request(ws, host, Headers);
MyRequest = new ServerRequest(ws, host, Headers);

MyUri = host;

Expand Down

0 comments on commit 2d9adf1

Please sign in to comment.