initialize endpoint attributes (untested, yeet)
This commit is contained in:
parent
30daf382ba
commit
2e4570a560
|
|
@ -132,11 +132,12 @@ public sealed class HttpServer {
|
|||
}
|
||||
|
||||
// stores the check attributes that are defined on the method and on the containing class
|
||||
var requiredChecks = mi.GetCustomAttributes<InternalEndpointCheckAttribute>(true).Concat(mi.DeclaringType?.GetCustomAttributes<InternalEndpointCheckAttribute>(true) ?? Enumerable.Empty<Attribute>())
|
||||
.Where(a => a.GetType().IsAssignableTo(typeof(InternalEndpointCheckAttribute))).Cast<InternalEndpointCheckAttribute>().ToArray();
|
||||
InternalEndpointCheckAttribute[] requiredChecks = mi.GetCustomAttributes<InternalEndpointCheckAttribute>(true)
|
||||
.Concat(mi.DeclaringType?.GetCustomAttributes<InternalEndpointCheckAttribute>(true) ?? Enumerable.Empty<Attribute>())
|
||||
.Where(a => a.GetType().IsAssignableTo(typeof(InternalEndpointCheckAttribute)))
|
||||
.Cast<InternalEndpointCheckAttribute>().ToArray();
|
||||
|
||||
foreach (var requiredCheck in requiredChecks)
|
||||
requiredCheck.SetInstance(classInstance);
|
||||
InternalEndpointCheckAttribute.Initialize(classInstance, requiredChecks);
|
||||
|
||||
foreach (var location in attrib.Locations) {
|
||||
var normLocation = NormalizeUrlPath(location);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user