autoformat

This commit is contained in:
GHXX 2024-01-09 04:28:45 +01:00
parent 1caeb6748b
commit 3e307c27fa
8 changed files with 13 additions and 48 deletions

View File

@ -3,15 +3,13 @@
namespace SimpleHttpServer; namespace SimpleHttpServer;
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
public class HttpEndpoint<T> : Attribute where T : IAuthorizer public class HttpEndpoint<T> : Attribute where T : IAuthorizer {
{
public HttpRequestType Type { get; private set; } public HttpRequestType Type { get; private set; }
public string Location { get; private set; } public string Location { get; private set; }
public Type Authorizer { get; private set; } public Type Authorizer { get; private set; }
public HttpEndpoint(HttpRequestType type, string location) public HttpEndpoint(HttpRequestType type, string location) {
{
Type = type; Type = type;
Location = location; Location = location;
Authorizer = typeof(T); Authorizer = typeof(T);
@ -19,7 +17,6 @@ public class HttpEndpoint<T> : Attribute where T : IAuthorizer
} }
[AttributeUsage(AttributeTargets.Method)] [AttributeUsage(AttributeTargets.Method)]
public class HttpEndpoint : HttpEndpoint<DefaultAuthorizer> public class HttpEndpoint : HttpEndpoint<DefaultAuthorizer> {
{
public HttpEndpoint(HttpRequestType type, string location) : base(type, location) { } public HttpEndpoint(HttpRequestType type, string location) : base(type, location) { }
} }

View File

@ -1,14 +1,8 @@
using System; namespace SimpleHttpServer;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SimpleHttpServer;
internal class HttpHandlingException : Exception { internal class HttpHandlingException : Exception {
public readonly int status; public readonly int status;
public HttpHandlingException(int status, string msg) : base(msg) { public HttpHandlingException(int status, string msg) : base(msg) {
this.status = status; this.status = status;
} }
} }

View File

@ -1,9 +1,4 @@
using System; using System.Net;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
namespace SimpleHttpServer; namespace SimpleHttpServer;
public class HttpResponseBuilder { public class HttpResponseBuilder {

View File

@ -1,13 +1,13 @@
using System.Net; using SimpleHttpServer.Internal;
using System.Net;
using System.Reflection; using System.Reflection;
using SimpleHttpServer.Internal;
namespace SimpleHttpServer; namespace SimpleHttpServer;
public sealed class HttpServer { public sealed class HttpServer {
private Thread? _listenerThread; 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> _plainEndpoints = new();
private readonly Dictionary<(string path, HttpRequestType rType), HttpEndpointHandler> _pparamEndpoints = new(); private readonly Dictionary<(string path, HttpRequestType rType), HttpEndpointHandler> _pparamEndpoints = new();

View File

@ -1,12 +1,7 @@
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections; using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Net; using System.Net;
using System.Reflection; using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace SimpleHttpServer.Internal; namespace SimpleHttpServer.Internal;

View File

@ -1,10 +1,7 @@
using System; using Konscious.Security.Cryptography;
using System.Collections.Generic; using Newtonsoft.Json;
using System.Linq;
using System.Security.Cryptography; using System.Security.Cryptography;
using System.Text; using System.Text;
using Konscious.Security.Cryptography;
using Newtonsoft.Json;
namespace SimpleHttpServer.Login; namespace SimpleHttpServer.Login;

View File

@ -1,11 +1,4 @@
using System; namespace SimpleHttpServerTest.SimpleTestServer;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SimpleHttpServer.Login;
namespace SimpleHttpServerTest.SimpleTestServer;
internal class LdAuthorizer { internal class LdAuthorizer {
private readonly LoginProvider lprov; private readonly LoginProvider lprov;

View File

@ -1,10 +1,4 @@
using System; namespace SimpleHttpServerTest.SimpleTestServer;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SimpleHttpServerTest.SimpleTestServer;
internal class SimpleEndpointDefinition { internal class SimpleEndpointDefinition {
} }