1- using System . Net . Http . Json ;
1+ using System . Net . Http . Json ;
22using DebugProbe . AspNetCore . Handlers ;
33using DebugProbe . AspNetCore . Internal . Compare ;
44using DebugProbe . AspNetCore . Internal . Rendering ;
@@ -90,9 +90,11 @@ public static IApplicationBuilder UseDebugProbe(this IApplicationBuilder app, Ac
9090
9191 if ( app is WebApplication webApp )
9292 {
93+ var prefix = options . RoutePrefix ;
94+
9395 if ( ShouldMapUiEndpoints ( environment , options ) )
9496 {
95- RequireDebugAuthorization ( webApp . MapGet ( "/debug" , async ( HttpContext ctx , DebugEntryStore store ) =>
97+ RequireDebugAuthorization ( webApp . MapGet ( prefix , async ( HttpContext ctx , DebugEntryStore store ) =>
9698 {
9799 var items = store . GetAll ( )
98100 . OrderByDescending ( x => x . Timestamp )
@@ -105,7 +107,7 @@ public static IApplicationBuilder UseDebugProbe(this IApplicationBuilder app, Ac
105107
106108 } ) . ExcludeFromDescription ( ) , options ) ;
107109
108- RequireDebugAuthorization ( webApp . MapGet ( "/debug/{id }", async ( HttpContext ctx , string id , DebugEntryStore store ) =>
110+ RequireDebugAuthorization ( webApp . MapGet ( $ " { prefix } /{{id} }", async ( HttpContext ctx , string id , DebugEntryStore store ) =>
109111 {
110112 var item = store . Get ( id ) ;
111113
@@ -139,7 +141,7 @@ public static IApplicationBuilder UseDebugProbe(this IApplicationBuilder app, Ac
139141
140142 } ) . ExcludeFromDescription ( ) , options ) ;
141143
142- RequireDebugAuthorization ( webApp . MapGet ( "/debug/ js/{file}", ( string file ) =>
144+ RequireDebugAuthorization ( webApp . MapGet ( $ " { prefix } / js/{{ file} }", ( string file ) =>
143145 {
144146 if ( ! EmbeddedResources . JavaScript . TryGetValue ( file , out var content ) )
145147 {
@@ -150,24 +152,24 @@ public static IApplicationBuilder UseDebugProbe(this IApplicationBuilder app, Ac
150152
151153 } ) . ExcludeFromDescription ( ) , options ) ;
152154
153- RequireDebugAuthorization ( webApp . MapPost ( "/debug /clear", ( DebugEntryStore store ) =>
155+ RequireDebugAuthorization ( webApp . MapPost ( $ " { prefix } /clear", ( DebugEntryStore store ) =>
154156 {
155157 store . Clear ( ) ;
156158
157159 return Results . Ok ( ) ;
158160
159161 } ) . ExcludeFromDescription ( ) , options ) ;
160162
161- RequireDebugAuthorization ( webApp . Map ( "/debug /logo.png", ctx =>
163+ RequireDebugAuthorization ( webApp . Map ( $ " { prefix } /logo.png", ctx =>
162164 EmbeddedAssetWriter . WriteEmbeddedAsset ( ctx , "DebugProbe.AspNetCore.Assets.images.debugprobe_logo_white_transparent.png" , "image/png" )
163165 ) . ExcludeFromDescription ( ) , options ) ;
164166
165- RequireDebugAuthorization ( webApp . Map ( "/debug /favicon.ico", ctx =>
167+ RequireDebugAuthorization ( webApp . Map ( $ " { prefix } /favicon.ico", ctx =>
166168 EmbeddedAssetWriter . WriteEmbeddedAsset ( ctx , "DebugProbe.AspNetCore.Assets.images.debugprobe_favicon.ico" , "image/x-icon" )
167169 ) . ExcludeFromDescription ( ) , options ) ;
168170 }
169171
170- RequireDebugAuthorization ( webApp . MapGet ( "/debug/ compare/{id }", async ( string id , string baseUrl , string remoteTraceId ,
172+ RequireDebugAuthorization ( webApp . MapGet ( $ " { prefix } / compare/{{id} }", async ( string id , string baseUrl , string remoteTraceId ,
171173 DebugEntryStore store ,
172174 DebugProbeOptions options ) =>
173175 {
@@ -191,9 +193,9 @@ public static IApplicationBuilder UseDebugProbe(this IApplicationBuilder app, Ac
191193 return Results . BadRequest ( validation . Error ) ;
192194 }
193195
194- var remoteEnvironmentUrl = new Uri ( validation . BaseUri ! , "/debug /environment") ;
196+ var remoteEnvironmentUrl = new Uri ( validation . BaseUri ! , $ " { prefix } /environment") ;
195197
196- var remoteEntryUrl = new Uri ( validation . BaseUri ! , $ "/debug /json/{ remoteTraceId } ") ;
198+ var remoteEntryUrl = new Uri ( validation . BaseUri ! , $ "{ prefix } /json/{ remoteTraceId } ") ;
197199
198200 DebugEntry ? remoteEntry ;
199201 DebugEnvironment ? remoteEnvironment ;
@@ -246,13 +248,13 @@ public static IApplicationBuilder UseDebugProbe(this IApplicationBuilder app, Ac
246248
247249 } ) . ExcludeFromDescription ( ) , options ) ;
248250
249- RequireDebugAuthorization ( webApp . MapGet ( "/debug /environment", ( DebugEntryStore store ) =>
251+ RequireDebugAuthorization ( webApp . MapGet ( $ " { prefix } /environment", ( DebugEntryStore store ) =>
250252 {
251253 return Results . Ok ( store . Environment ) ;
252254
253255 } ) . ExcludeFromDescription ( ) , options ) ;
254256
255- RequireDebugAuthorization ( webApp . MapGet ( "/debug/ json/{id }", ( string id , DebugEntryStore store ) =>
257+ RequireDebugAuthorization ( webApp . MapGet ( $ " { prefix } / json/{{id} }", ( string id , DebugEntryStore store ) =>
256258 {
257259 var item = store . Get ( id ) ;
258260
0 commit comments