autoformat
This commit is contained in:
parent
1caeb6748b
commit
3e307c27fa
|
|
@ -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) { }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,4 @@
|
|||
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;
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user