diff --git a/SimpleHttpServer/HttpEndpoint.cs b/SimpleHttpServer/HttpEndpoint.cs index 0993696..8e673a9 100644 --- a/SimpleHttpServer/HttpEndpoint.cs +++ b/SimpleHttpServer/HttpEndpoint.cs @@ -3,15 +3,13 @@ namespace SimpleHttpServer; [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] -public class HttpEndpoint : Attribute where T : IAuthorizer -{ +public class HttpEndpoint : Attribute where T : IAuthorizer { public HttpRequestType Type { get; private set; } public string Location { get; private set; } public Type Authorizer { get; private set; } - public HttpEndpoint(HttpRequestType type, string location) - { + public HttpEndpoint(HttpRequestType type, string location) { Type = type; Location = location; Authorizer = typeof(T); @@ -19,7 +17,6 @@ public class HttpEndpoint : Attribute where T : IAuthorizer } [AttributeUsage(AttributeTargets.Method)] -public class HttpEndpoint : HttpEndpoint -{ +public class HttpEndpoint : HttpEndpoint { public HttpEndpoint(HttpRequestType type, string location) : base(type, location) { } } diff --git a/SimpleHttpServer/HttpHandlingException.cs b/SimpleHttpServer/HttpHandlingException.cs index 832469b..08f3c02 100644 --- a/SimpleHttpServer/HttpHandlingException.cs +++ b/SimpleHttpServer/HttpHandlingException.cs @@ -1,14 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SimpleHttpServer; +namespace SimpleHttpServer; internal class HttpHandlingException : Exception { public readonly int status; - public HttpHandlingException(int status, string msg) : base(msg) { + public HttpHandlingException(int status, string msg) : base(msg) { this.status = status; } } diff --git a/SimpleHttpServer/HttpResponseBuilder.cs b/SimpleHttpServer/HttpResponseBuilder.cs index 0fa621c..7ebca9c 100644 --- a/SimpleHttpServer/HttpResponseBuilder.cs +++ b/SimpleHttpServer/HttpResponseBuilder.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Text; -using System.Threading.Tasks; +using System.Net; namespace SimpleHttpServer; public class HttpResponseBuilder { diff --git a/SimpleHttpServer/HttpServer.cs b/SimpleHttpServer/HttpServer.cs index 63fdb41..6c98a26 100644 --- a/SimpleHttpServer/HttpServer.cs +++ b/SimpleHttpServer/HttpServer.cs @@ -1,13 +1,13 @@ -using System.Net; +using SimpleHttpServer.Internal; +using System.Net; using System.Reflection; -using SimpleHttpServer.Internal; namespace SimpleHttpServer; public sealed class HttpServer { private Thread? _listenerThread; - private HttpListener _listener; + private readonly HttpListener _listener; private readonly Dictionary<(string path, HttpRequestType rType), HttpEndpointHandler> _plainEndpoints = new(); private readonly Dictionary<(string path, HttpRequestType rType), HttpEndpointHandler> _pparamEndpoints = new(); diff --git a/SimpleHttpServer/Internal/HttpEndpointHandler.cs b/SimpleHttpServer/Internal/HttpEndpointHandler.cs index 948eadc..63bf7bc 100644 --- a/SimpleHttpServer/Internal/HttpEndpointHandler.cs +++ b/SimpleHttpServer/Internal/HttpEndpointHandler.cs @@ -1,12 +1,7 @@ using Newtonsoft.Json; -using System; using System.Collections; -using System.Collections.Generic; -using System.Linq; using System.Net; using System.Reflection; -using System.Text; -using System.Threading.Tasks; namespace SimpleHttpServer.Internal; diff --git a/SimpleHttpServer/Login/LoginProvider.cs b/SimpleHttpServer/Login/LoginProvider.cs index e0fc5e8..a91174a 100644 --- a/SimpleHttpServer/Login/LoginProvider.cs +++ b/SimpleHttpServer/Login/LoginProvider.cs @@ -1,10 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; +using Konscious.Security.Cryptography; +using Newtonsoft.Json; using System.Security.Cryptography; using System.Text; -using Konscious.Security.Cryptography; -using Newtonsoft.Json; namespace SimpleHttpServer.Login; diff --git a/SimpleHttpServerTest/SimpleTestServer/LdAuthorizer.cs b/SimpleHttpServerTest/SimpleTestServer/LdAuthorizer.cs index 3b7afe9..d4d95d2 100644 --- a/SimpleHttpServerTest/SimpleTestServer/LdAuthorizer.cs +++ b/SimpleHttpServerTest/SimpleTestServer/LdAuthorizer.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using SimpleHttpServer.Login; - -namespace SimpleHttpServerTest.SimpleTestServer; +namespace SimpleHttpServerTest.SimpleTestServer; internal class LdAuthorizer { private readonly LoginProvider lprov; diff --git a/SimpleHttpServerTest/SimpleTestServer/SimpleEndpointDefinition.cs b/SimpleHttpServerTest/SimpleTestServer/SimpleEndpointDefinition.cs index 7f0c00f..ba56883 100644 --- a/SimpleHttpServerTest/SimpleTestServer/SimpleEndpointDefinition.cs +++ b/SimpleHttpServerTest/SimpleTestServer/SimpleEndpointDefinition.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SimpleHttpServerTest.SimpleTestServer; +namespace SimpleHttpServerTest.SimpleTestServer; internal class SimpleEndpointDefinition { }