Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/typos #157

Merged
merged 4 commits into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/Models/PermittedCrossDomainPolicyConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ public string BuildHeaderValue()
switch (XPermittedCrossDomainOptionValue)
{
case XPermittedCrossDomainOptionValue.none:
return "none;";
return "none";
case XPermittedCrossDomainOptionValue.masterOnly:
return "master-only;";
return "master-only";
case XPermittedCrossDomainOptionValue.byContentType:
return "by-content-type;";
return "by-content-type";
case XPermittedCrossDomainOptionValue.byFtpFileType:
return "by-ftp-file-type;";
return "by-ftp-file-type";
case XPermittedCrossDomainOptionValue.all:
return "all;";
return "all";
default:
ArgumentExceptionHelper.RaiseException(nameof(XPermittedCrossDomainOptionValue));
break;
Expand Down
8 changes: 4 additions & 4 deletions src/Models/XFrameOptionsConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ public string BuildHeaderValue()
switch (OptionValue)
{
case XFrameOptions.Deny:
return "DENY";
return "deny";
case XFrameOptions.Sameorigin:
return "SAMEORIGIN";
return "sameorigin";
case XFrameOptions.Allowfrom:
HeaderValueGuardClauses.StringCannotBeNullOrWhitsSpace(AllowFromDomain, nameof(AllowFromDomain));
return $"ALLOW-FROM({AllowFromDomain})";
return $"allow-from: ({AllowFromDomain})";
case XFrameOptions.AllowAll:
return "ALLOWALL";
return "allowall";
}
// We should never hit this return statement. It is included here
// as the method NEEDs to return something.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public async Task AllHeaders_Present_When_BuildDefault_Used()

Assert.True(headerPresentConfig.UseXFrameOptions);
Assert.Contains(context.Response.Headers, h => h.Key == Constants.XFrameOptionsHeaderName);
Assert.Equal("DENY", context.Response.Headers[Constants.XFrameOptionsHeaderName]);
Assert.Equal("deny", context.Response.Headers[Constants.XFrameOptionsHeaderName]);

Assert.True(headerPresentConfig.UseXssProtection);
Assert.Contains(context.Response.Headers, h => h.Key == Constants.XssProtectionHeaderName);
Expand All @@ -44,7 +44,7 @@ public async Task AllHeaders_Present_When_BuildDefault_Used()

Assert.True(headerPresentConfig.UsePermittedCrossDomainPolicy);
Assert.Contains(context.Response.Headers, h => h.Key == Constants.PermittedCrossDomainPoliciesHeaderName);
Assert.Equal("none;", context.Response.Headers[Constants.PermittedCrossDomainPoliciesHeaderName]);
Assert.Equal("none", context.Response.Headers[Constants.PermittedCrossDomainPoliciesHeaderName]);

Assert.True(headerPresentConfig.UseReferrerPolicy);
Assert.Contains(context.Response.Headers, h => h.Key == Constants.ReferrerPolicyHeaderName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private void AssertHeadersInResponse(SecureHeadersMiddlewareConfiguration middle

// X-Frame-Options
Assert.True(middlewareConfiguration.UseXFrameOptions);
Assert.Equal("DENY", middlewareConfiguration.XFrameOptionsConfiguration.BuildHeaderValue());
Assert.Equal("deny", middlewareConfiguration.XFrameOptionsConfiguration.BuildHeaderValue());

// X-Content-Type-Options
Assert.True(middlewareConfiguration.UseXContentTypeOptions);
Expand All @@ -116,7 +116,7 @@ private void AssertHeadersInResponse(SecureHeadersMiddlewareConfiguration middle

// X-Permitted-Cross-Domain-Policies
Assert.True(middlewareConfiguration.UsePermittedCrossDomainPolicy);
Assert.Equal("none;", middlewareConfiguration.PermittedCrossDomainPolicyConfiguration.BuildHeaderValue());
Assert.Equal("none", middlewareConfiguration.PermittedCrossDomainPolicyConfiguration.BuildHeaderValue());

// Referrer-Policy
Assert.True(middlewareConfiguration.UseReferrerPolicy);
Expand Down
Loading