initialize endpoint attributes (untested, yeet)

This commit is contained in:
00asdf 2024-07-27 00:16:38 +02:00
parent 30daf382ba
commit 2e4570a560

View File

@ -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);