Switch over to a check-based system with multi attribute support
This commit is contained in:
1 parent
fa79134d02
commit
c75d29a1ba
4 files changed
+53
-27
No files matched your search
@@ -0,0 +1,15 @@
|
||||
using System.Net;
|
||||
|
||||
namespace SimpleHttpServer.Types;
|
||||
|
||||
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, Inherited = true, AllowMultiple = true)]
|
||||
public abstract class BaseEndpointCheckAttribute : Attribute {
|
||||
|
||||
public BaseEndpointCheckAttribute() { }
|
||||
|
||||
/// <summary>
|
||||
/// Executed when the endpoint is invoked. The endpoint invocation is skipped if any of the checks fail.
|
||||
/// </summary>
|
||||
/// <returns>True to allow invocation, false to prevent.</returns>
|
||||
public abstract bool Check(HttpListenerRequest req);
|
||||
}
|
||||
Reference in new issue
Block a user