Skip to content
This repository has been archived by the owner on Jun 25, 2020. It is now read-only.

Commit

Permalink
Add index.xml to default pages for feeds directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Jérémie Bertrand committed Oct 29, 2016
1 parent 1506f90 commit a0634fd
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Pretzel/WebHost/FileContentProvider.cs
Expand Up @@ -94,7 +94,7 @@ public byte[] GetBinaryContent(string request)
return fileContents;
}

private static readonly string[] defaultPages = { "index.html", "index.htm", "default.htm", "default.html" };
private static readonly string[] defaultPages = { "index.html", "index.htm", "default.htm", "default.html", "index.xml" };

/// <summary>
/// Get the path for the page to send to the user
Expand All @@ -110,8 +110,7 @@ private string GetRequestedPage(string request)
{
string defaultPage = defaultPages
.Select(page => Path.Combine(requestString, page))
.Where(page => File.Exists(page))
.FirstOrDefault();
.FirstOrDefault(page => File.Exists(page));

if (defaultPage != null)
return defaultPage;
Expand All @@ -125,7 +124,7 @@ private string GetRequestedPage(string request)
/// </summary>
/// <param name="request"></param>
/// <returns>Path to the file</returns>
private string GetFullPath(string request)
private string GetFullPath(string request)
{
return System.Web.HttpUtility.UrlDecode(Path.Combine(basePath + request));
}
Expand Down

0 comments on commit a0634fd

Please sign in to comment.