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;
[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 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<T> : Attribute where T : IAuthorizer
}
[AttributeUsage(AttributeTargets.Method)]
public class HttpEndpoint : HttpEndpoint<DefaultAuthorizer>
{
public class HttpEndpoint : HttpEndpoint<DefaultAuthorizer> {
public HttpEndpoint(HttpRequestType type, string location) : base(type, location) { }
}

View File

@ -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;
}
}

View File

@ -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 {

View File

@ -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();

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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 {
}