Huge refactor; Passing tests
This commit is contained in:
1 parent
3e307c27fa
commit
09fa3b8734
18 files changed
+577
-162
No files matched your search
@@ -0,0 +1,22 @@
|
||||
using SimpleHttpServer.Internal;
|
||||
|
||||
namespace SimpleHttpServer;
|
||||
|
||||
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
|
||||
public class HttpEndpointAttribute<T> : Attribute where T : IAuthorizer {
|
||||
|
||||
public HttpRequestType RequestMethod { get; private set; }
|
||||
public string[] Locations { get; private set; }
|
||||
public Type Authorizer { get; private set; }
|
||||
|
||||
public HttpEndpointAttribute(HttpRequestType requestMethod, params string[] locations) {
|
||||
RequestMethod = requestMethod;
|
||||
Locations = locations;
|
||||
Authorizer = typeof(T);
|
||||
}
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
public class HttpEndpointAttribute : HttpEndpointAttribute<DefaultAuthorizer> {
|
||||
public HttpEndpointAttribute(HttpRequestType type, params string[] locations) : base(type, locations) { }
|
||||
}
|
||||
Reference in new issue
Block a user