fix #1037 to use route information instead #1038

Closed
wants to merge 1 commit into from

2 participants

@suwatch
projectkudu member

fix #1037. it is more like engineering improvement to reduce/avoid paths manipulation.

@davidebbo davidebbo commented on the diff Feb 25, 2014
Kudu.Services/Diagnostics/LogStreamManager.cs
@@ -265,36 +265,37 @@ private string ParseRequest(HttpContext context)
{
_filter = context.Request.QueryString[FilterQueryKey];
- string[] paths = context.Request.Path.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
+ // path route as in logstream/{*path} without query strings
+ string route = context.Request.RequestContext.RouteData.Values["path"] as string;
@davidebbo
projectkudu member

routePath or just path might be a clearer name than route

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@davidebbo davidebbo commented on the diff Feb 25, 2014
Kudu.Services/Diagnostics/LogStreamManager.cs
}
- paths[0] = _logPath;
- _enableTrace = paths.Length == 1;
-
- if (paths.Length > 1)
+ // in case of application or http log, we ensure directory
+ string path = route.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries)[0];
@davidebbo
projectkudu member

Here I'd use something like firstSegment or firstToken instead of path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@davidebbo
projectkudu member

Looks good. Just some minor naming suggestions.

@suwatch suwatch closed this Feb 25, 2014
@suwatch suwatch deleted the suwatch_work branch Feb 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment