public void UaSupportsUpgradeInsecureRequests_UpgradeHeaderNotOk_ReturnsFalse() { SetRequestUpgradeHeader("yolo"); var helper = new CspUpgradeInsecureRequestHelper(); Assert.IsFalse(helper.UaSupportsUpgradeInsecureRequests(_request.Object)); }
internal void SetSitewideHeadersFromConfig(HttpContextBase context) { var nwebsecContext = context.GetNWebsecContext(); SetHstsHeader(context.Response, context.Request.IsSecureConnection, _cspUpgradeRequestHelper.UaSupportsUpgradeInsecureRequests(context.Request)); SetHpkpHeader(context.Response, context.Request.IsSecureConnection, false); SetHpkpHeader(context.Response, context.Request.IsSecureConnection, true); SetXRobotsTagHeader(context.Response, nwebsecContext); SetXFrameoptionsHeader(context.Response, nwebsecContext); SetXContentTypeOptionsHeader(context.Response, nwebsecContext); SetXDownloadOptionsHeader(context.Response, nwebsecContext); }
internal void SetSitewideHeadersFromConfig(HttpContextBase context) { var nwebsecContext = context.GetNWebsecContext(); var httpContext = new HttpContextWrapper(context); SetHstsHeader(httpContext, context.Request.IsSecureConnection, _cspUpgradeRequestHelper.UaSupportsUpgradeInsecureRequests(context.Request)); SetXRobotsTagHeader(httpContext, nwebsecContext); SetXFrameoptionsHeader(httpContext, nwebsecContext); SetXContentTypeOptionsHeader(httpContext, nwebsecContext); SetXDownloadOptionsHeader(httpContext, nwebsecContext); SetReferrerPolicyHeader(httpContext, nwebsecContext); }
public void UaSupportsUpgradeInsecureRequests_NotSupported_ReturnsFalse() { var helper = new CspUpgradeInsecureRequestHelper(); Assert.IsFalse(helper.UaSupportsUpgradeInsecureRequests(_request.Object)); }