diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-02-12 17:53:14 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-02-12 17:53:14 -0500 |
| commit | a6e7438987ebd0ef2c44940f76e6efd487803e02 (patch) | |
| tree | ce2de4a9ecc13dc97eb8eeb5346de0e191ec6e5a /ServiceStack/Host/ServiceController.cs | |
| parent | a0f4a628dd1f7f374cd992aca97f5d50a70c3d02 (diff) | |
fix turkish character recognition problems
Diffstat (limited to 'ServiceStack/Host/ServiceController.cs')
| -rw-r--r-- | ServiceStack/Host/ServiceController.cs | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/ServiceStack/Host/ServiceController.cs b/ServiceStack/Host/ServiceController.cs index 378c21d5d..158097dd0 100644 --- a/ServiceStack/Host/ServiceController.cs +++ b/ServiceStack/Host/ServiceController.cs @@ -5,6 +5,7 @@ using System.Linq; using System.Reflection; using System.Text; using System.Threading.Tasks; +using MediaBrowser.Model.Logging; using MediaBrowser.Model.Services; namespace ServiceStack.Host @@ -135,7 +136,7 @@ namespace ServiceStack.Host appHost.RestPaths.AddRange(RestPathMap.Values.SelectMany(x => x)); } - public RestPath GetRestPathForRequest(string httpMethod, string pathInfo) + public RestPath GetRestPathForRequest(string httpMethod, string pathInfo, ILogger logger) { var matchUsingPathParts = RestPath.GetPathPartsForMatching(pathInfo); @@ -144,19 +145,23 @@ namespace ServiceStack.Host var yieldedHashMatches = RestPath.GetFirstMatchHashKeys(matchUsingPathParts); foreach (var potentialHashMatch in yieldedHashMatches) { - if (!this.RestPathMap.TryGetValue(potentialHashMatch, out firstMatches)) continue; + if (!this.RestPathMap.TryGetValue(potentialHashMatch, out firstMatches)) + { + continue; + } var bestScore = -1; foreach (var restPath in firstMatches) { - var score = restPath.MatchScore(httpMethod, matchUsingPathParts); + var score = restPath.MatchScore(httpMethod, matchUsingPathParts, logger); if (score > bestScore) bestScore = score; } + if (bestScore > 0) { foreach (var restPath in firstMatches) { - if (bestScore == restPath.MatchScore(httpMethod, matchUsingPathParts)) + if (bestScore == restPath.MatchScore(httpMethod, matchUsingPathParts, logger)) return restPath; } } @@ -170,14 +175,14 @@ namespace ServiceStack.Host var bestScore = -1; foreach (var restPath in firstMatches) { - var score = restPath.MatchScore(httpMethod, matchUsingPathParts); + var score = restPath.MatchScore(httpMethod, matchUsingPathParts, logger); if (score > bestScore) bestScore = score; } if (bestScore > 0) { foreach (var restPath in firstMatches) { - if (bestScore == restPath.MatchScore(httpMethod, matchUsingPathParts)) + if (bestScore == restPath.MatchScore(httpMethod, matchUsingPathParts, logger)) return restPath; } } |
