Skip to content

Commit

Permalink
Update comment
Browse files Browse the repository at this point in the history
  • Loading branch information
gcbeattyAWS committed Dec 23, 2024
1 parent d96af57 commit c3bf7cd
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ private static string PreprocessRouteTemplate(string template)
// Convert AWS-style {proxy+} to ASP.NET Core style {*proxy}
template = Regex.Replace(template, @"\{(\w+)\+\}", "{*$1}");

// Handle AWS-style "constraints" by replacing them with temporary parameter names
// AWS allows you to name a route as {abc:int}, which gets parsed by AWS as the path
// variable abc:int. However, .NET template matcher, thinks {abc:int} means
// abc variable with the int constraint. So we are converting variables that have
// contstraints to a different name temporarily, so template matcher doesn't think they are constraints.
return Regex.Replace(template, @"\{([^}]+):([^}]+)\}", match =>
{
var paramName = match.Groups[1].Value;
Expand Down

0 comments on commit c3bf7cd

Please sign in to comment.