Skip to content

Commit 29eabf9

Browse files
committed
Added external vendor files
1 parent 0144c76 commit 29eabf9

File tree

6 files changed

+260
-8
lines changed

6 files changed

+260
-8
lines changed

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
*.userosscache
88
*.sln.docstates
99

10+
SelfHosting.Nancy/Views/content/vendor/*
11+
!.gitkeep
12+
1013
# User-specific files (MonoDevelop/Xamarin Studio)
1114
*.userprefs
1215

@@ -129,7 +132,7 @@ publish/
129132
# Publish Web Output
130133
*.[Pp]ublish.xml
131134
*.azurePubxml
132-
# TODO: Comment the next line if you want to checkin your web deploy settings
135+
# TODO: Comment the next line if you want to checkin your web deploy settings
133136
# but database connection strings (with potential passwords) will be unencrypted
134137
*.pubxml
135138
*.publishproj

SelfHosting.Nancy/Bootstrapper.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,15 @@ protected override void ConfigureConventions(NancyConventions nancyConventions)
6767
{
6868
base.ConfigureConventions(nancyConventions);
6969

70-
nancyConventions.StaticContentsConventions.Add(AddStaticResourcePath("/Content", Assembly.GetAssembly(typeof(Bootstrapper)), "SelfHosting.Nancy.Content"));
70+
nancyConventions.StaticContentsConventions.Add(AddStaticResourcePath("/content", Assembly.GetAssembly(typeof(Bootstrapper)), "SelfHosting.Nancy.Views.content"));
7171
}
7272

7373
private static Func<NancyContext, string, Response> AddStaticResourcePath(string requestedPath, Assembly assembly, string namespacePrefix)
7474
{
7575
return (context, s) =>
7676
{
7777
var path = context.Request.Path;
78-
if (!path.StartsWith(requestedPath))
78+
if (!path.StartsWith(requestedPath, StringComparison.InvariantCultureIgnoreCase))
7979
{
8080
return null;
8181
}
@@ -94,7 +94,7 @@ private static Func<NancyContext, string, Response> AddStaticResourcePath(string
9494
name = adjustedPath;
9595
resourcePath = namespacePrefix;
9696
}
97-
return new EmbeddedFileResponse(assembly, resourcePath, name);
97+
return new EmbeddedFileResponse(assembly, resourcePath.Replace("-", "_"), name);
9898
};
9999
}
100100
}

0 commit comments

Comments
 (0)