Skip to content

Commit

Permalink
Trim beginning /
Browse files Browse the repository at this point in the history
  • Loading branch information
mauroservienti committed Jun 24, 2020
1 parent d54aee9 commit e92d9ef
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ServiceComposer.AspNetCore/EndpointsExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public static void MapCompositionHandlers(this IEndpointRouteBuilder endpoints,

var compositionMetadataRegistry =
endpoints.ServiceProvider.GetRequiredService<CompositionMetadataRegistry>();

MapGetComponents(compositionMetadataRegistry, endpoints.DataSources);
if (enableWriteSupport)
{
Expand Down Expand Up @@ -132,7 +133,7 @@ private static CompositionEndpointBuilder CreateCompositionEndpointBuilder(IGrou
.Select<Type, (Type ComponentType, MethodInfo Method, string Template)>(componentType =>
{
var method = ExtractMethod(componentType);
var template = method.GetCustomAttribute<TAttribute>()?.Template;
var template = method.GetCustomAttribute<TAttribute>()?.Template.TrimStart('/');
return (componentType, method, template);
})
.Where(component => component.Template != null)
Expand Down

0 comments on commit e92d9ef

Please sign in to comment.