From 2d9adf1634782729d467ce0b6939a81f6831eb1d Mon Sep 17 00:00:00 2001 From: "Alecio Furanze (Ale)" Date: Tue, 18 Jun 2024 13:54:54 +0200 Subject: [PATCH] rename HTTP.Response -> HTTP.ServerResponse --- src/http/partials/Server/HTTP.Request.cs | 8 ++++---- .../Server/{HTTP.Response.cs => HTTP.ServerResponse.cs} | 2 +- src/http/partials/Server/HTTP.ServerTo.cs | 2 +- src/http/partials/Websocket/HTTP.WebSocketTo.cs | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) rename src/http/partials/Server/{HTTP.Response.cs => HTTP.ServerResponse.cs} (97%) diff --git a/src/http/partials/Server/HTTP.Request.cs b/src/http/partials/Server/HTTP.Request.cs index da226b98..91e7042d 100644 --- a/src/http/partials/Server/HTTP.Request.cs +++ b/src/http/partials/Server/HTTP.Request.cs @@ -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(); @@ -70,7 +70,7 @@ internal Request(HttpListenerRequest request) } } - internal Request(ClientWebSocket ws, Uri uri, Dictionary headers) + internal ServerRequest(ClientWebSocket ws, Uri uri, Dictionary headers) { // websocket client side @@ -134,7 +134,7 @@ internal Request(ClientWebSocket ws, Uri uri, Dictionary headers } } - internal Request(HttpResponseMessage message) + internal ServerRequest(HttpResponseMessage message) { var uri = message.RequestMessage.RequestUri; diff --git a/src/http/partials/Server/HTTP.Response.cs b/src/http/partials/Server/HTTP.ServerResponse.cs similarity index 97% rename from src/http/partials/Server/HTTP.Response.cs rename to src/http/partials/Server/HTTP.ServerResponse.cs index f3028f84..ec7bbcc4 100644 --- a/src/http/partials/Server/HTTP.Response.cs +++ b/src/http/partials/Server/HTTP.ServerResponse.cs @@ -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}"); } }); } diff --git a/src/http/partials/Server/HTTP.ServerTo.cs b/src/http/partials/Server/HTTP.ServerTo.cs index 4d9a3636..ca712619 100644 --- a/src/http/partials/Server/HTTP.ServerTo.cs +++ b/src/http/partials/Server/HTTP.ServerTo.cs @@ -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}"); diff --git a/src/http/partials/Websocket/HTTP.WebSocketTo.cs b/src/http/partials/Websocket/HTTP.WebSocketTo.cs index 0a18284f..d9f3c52d 100644 --- a/src/http/partials/Websocket/HTTP.WebSocketTo.cs +++ b/src/http/partials/Websocket/HTTP.WebSocketTo.cs @@ -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;