Skip to content

Commit c65c619

Browse files
author
Alejandro Panizza Carve
committed
- fix errors when rest methods override with path parameters.
1 parent c2ccfbf commit c65c619

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

dotnet/src/dotnetframework/GxClasses/Middleware/HandlerFactory.cs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -258,11 +258,13 @@ public bool GetSMap(string actualPath, string objectName, string objectNameUp,
258258
}
259259
else
260260
{
261+
bool pathFound = false;
261262
mapRegexp = mapName;
262263
foreach (SingleMap m in GXAPIModule.servicesMap[actualPath].Values)
263-
{
264+
{
264265
if (!m.Path.Equals(m.PathRegexp) && GxRegex.IsMatch(objectName, m.PathRegexp))
265266
{
267+
pathFound = true;
266268
methodMismatch = false;
267269
// regexp URL match
268270
mapName = m.Name;
@@ -280,17 +282,17 @@ public bool GetSMap(string actualPath, string objectName, string objectNameUp,
280282
}
281283
methodMismatch = false;
282284
return true;
283-
}
284-
else
285-
{
286-
mapName = null;
287-
mapRegexp = null;
288-
routeParms = null;
289-
methodMismatch = true;
290-
return false;
291-
}
285+
}
292286
}
293287
}
288+
if (pathFound)
289+
{
290+
mapName = null;
291+
mapRegexp = null;
292+
routeParms = null;
293+
methodMismatch = true;
294+
return false;
295+
}
294296
}
295297
return false;
296298
}

0 commit comments

Comments
 (0)