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
|
// 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>())
|
InternalEndpointCheckAttribute[] requiredChecks = mi.GetCustomAttributes<InternalEndpointCheckAttribute>(true)
|
||||||
.Where(a => a.GetType().IsAssignableTo(typeof(InternalEndpointCheckAttribute))).Cast<InternalEndpointCheckAttribute>().ToArray();
|
.Concat(mi.DeclaringType?.GetCustomAttributes<InternalEndpointCheckAttribute>(true) ?? Enumerable.Empty<Attribute>())
|
||||||
|
.Where(a => a.GetType().IsAssignableTo(typeof(InternalEndpointCheckAttribute)))
|
||||||
|
.Cast<InternalEndpointCheckAttribute>().ToArray();
|
||||||
|
|
||||||
foreach (var requiredCheck in requiredChecks)
|
InternalEndpointCheckAttribute.Initialize(classInstance, requiredChecks);
|
||||||
requiredCheck.SetInstance(classInstance);
|
|
||||||
|
|
||||||
foreach (var location in attrib.Locations) {
|
foreach (var location in attrib.Locations) {
|
||||||
var normLocation = NormalizeUrlPath(location);
|
var normLocation = NormalizeUrlPath(location);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user