File tree Expand file tree Collapse file tree 2 files changed +19
-6
lines changed
dotnetcore/GxClasses.Web/Middleware
extensions/Azure/Handlers Expand file tree Collapse file tree 2 files changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -261,23 +261,36 @@ internal string GetGxRouteValue(string path)
261261 {
262262 //Not API Objects
263263 string basePath = restBaseURL ;
264+ string pathWithNoBase = string . IsNullOrEmpty ( basePath ) ? path . Substring ( 1 ) : path . Substring ( basePath . Length + 2 ) ;
264265
265266 //API Objects
267+ string AzureFunctionShortName = AzureFunctionName . Substring ( AzureFunctionName . LastIndexOf ( "." ) + 1 ) ;
268+ string controllerWithParms = "" ;
266269 foreach ( var map in servicesMap )
267270 {
268- foreach ( var mlist in map . Value )
271+ if ( path . ToLower ( ) . Contains ( map . Key . ToLower ( ) ) )
269272 {
270- if ( mlist . Key == AzureFunctionName )
273+ foreach ( var mlist in map . Value )
271274 {
272- basePath = string . IsNullOrEmpty ( restBaseURL ) ? $ "{ map . Key } " : $ "{ restBaseURL } /{ map . Key } ";
275+ if ( mlist . Key . ToLower ( ) == AzureFunctionShortName . ToLower ( ) )
276+ {
277+
278+ controllerWithParms = mlist . Value . Path ;
279+ if ( pathWithNoBase . ToLower ( ) . EndsWith ( controllerWithParms . ToLower ( ) ) )
280+ {
281+ if ( pathWithNoBase . Remove ( pathWithNoBase . Length - controllerWithParms . Length ) . ToLower ( ) == map . Key . ToLower ( ) )
282+ return controllerWithParms ;
283+ }
284+ }
273285 }
274286 }
275287 }
276288
277- string controllerWithParms = path . Remove ( 0 , basePath . Length + 1 ) ;
289+ controllerWithParms = path . Remove ( 0 , basePath . Length + 1 ) ;
278290 controllerWithParms = controllerWithParms . StartsWith ( "/" ) ? controllerWithParms . Remove ( 0 , 1 ) : controllerWithParms ;
279291 return controllerWithParms ;
280-
292+
293+
281294 }
282295 public bool ServiceInPath ( String path , out String actualPath )
283296 {
Original file line number Diff line number Diff line change 1- <Project Sdk =" Microsoft.NET.Sdk" >
1+ <Project Sdk =" Microsoft.NET.Sdk" >
22 <PropertyGroup >
33 <TargetFrameworks >net5.0;net6.0</TargetFrameworks >
44 <OutputType >Exe</OutputType >
You can’t perform that action at this time.
0 commit comments