Vacation Fixes (#709)

* Ignore system and hidden folders when performing directory scan.

* Fixed the comic parser tests not using Comic mode for parsing.

* Accept all forwarded headers and use them.

* Ignore some changes from another branch
This commit is contained in:
Joseph Milazzo 2021-11-01 13:34:43 -05:00 committed by GitHub
parent f99cf87ab5
commit 7ce13babad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 35 additions and 4 deletions

View file

@ -375,8 +375,11 @@ namespace API.Services
IEnumerable<string> subDirs;
string[] files;
try {
subDirs = Directory.GetDirectories(currentDir).Where(path => ExcludeDirectories.Matches(path).Count == 0);
try
{
// Default EnumerationOptions will ignore system and hidden folders
subDirs = Directory.GetDirectories(currentDir, "*", new EnumerationOptions())
.Where(path => ExcludeDirectories.Matches(path).Count == 0);
}
// Thrown if we do not have discovery permission on the directory.
catch (UnauthorizedAccessException e) {

View file

@ -106,6 +106,11 @@ namespace API
services.AddResponseCaching();
services.Configure<ForwardedHeadersOptions>(options =>
{
options.ForwardedHeaders =
ForwardedHeaders.All;
});
services.AddHangfire(configuration => configuration
.UseSimpleAssemblyNameTypeSerializer()
@ -140,7 +145,7 @@ namespace API
app.UseForwardedHeaders(new ForwardedHeadersOptions
{
ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
ForwardedHeaders = ForwardedHeaders.All
});
app.UseRouting();