public CspOptions() { Script = new CspScriptSrcOptions(); Style = new CspStyleSrcOptions(); Default = new CspDefaultSrcOptions(); #pragma warning disable CS0618 // Type or member is obsolete Child = new CspChildSrcOptions(); #pragma warning restore CS0618 // Type or member is obsolete Connect = new CspConnectSrcOptions(); Manifest = new CspManifestSrcOptions(); Font = new CspFontSrcOptions(); FormAction = new CspFormActionOptions(); Img = new CspImgSrcOptions(); Media = new CspMediaSrcOptions(); Object = new CspObjectSrcOptions(); FrameAncestors = new CspFrameAncestorsOptions(); PluginTypes = new CspPluginTypesOptions(); Sandbox = new CspSandboxOptions(); RequireSri = new CspRequireSriOptions(); Frame = new CspFrameSrcOptions(); Worker = new CspWorkerSrcOptions(); Prefetch = new CspPrefetchSrcOptions(); BaseUri = new CspBaseUriOptions(); OnSendingHeader = context => Task.CompletedTask; }
public void AllowScripts_SetsAllowScriptsToTrue() { var builder = new CspSandboxBuilder(); builder.AllowScripts(); CspSandboxOptions options = builder.BuildOptions(); Assert.True(options.AllowScripts); }
public void AllowSameOrigin_SetsAllowSameOriginToTrue() { var builder = new CspSandboxBuilder(); builder.AllowSameOrigin(); CspSandboxOptions options = builder.BuildOptions(); Assert.True(options.AllowSameOrigin); }
public void AllowPresentation_SetsAllowPresentationToTrue() { var builder = new CspSandboxBuilder(); builder.AllowPresentation(); CspSandboxOptions options = builder.BuildOptions(); Assert.True(options.AllowPresentation); }
public void AllowPopupsToEscapeSandbox_SetsAllowPopupsToEscapeSandboxToTrue() { var builder = new CspSandboxBuilder(); builder.AllowPopupsToEscapeSandbox(); CspSandboxOptions options = builder.BuildOptions(); Assert.True(options.AllowPopupsToEscapeSandbox); }
public void AllowPointerLock_SetsAllowPointerLockToTrue() { var builder = new CspSandboxBuilder(); builder.AllowPointerLock(); CspSandboxOptions options = builder.BuildOptions(); Assert.True(options.AllowPointerLock); }
public CspOptions() { Script = new CspScriptSrcOptions(); Style = new CspStyleSrcOptions(); Default = new CspDefaultSrcOptions(); Child = new CspChildSrcOptions(); Connect = new CspConnectSrcOptions(); Font = new CspFontSrcOptions(); FormAction = new CspFormActionOptions(); Img = new CspImgSrcOptions(); Media = new CspMediaSrcOptions(); Object = new CspObjectSrcOptions(); FrameAncestors = new CspFrameAncestorsOptions(); PluginTypes = new CspPluginTypesOptions(); Sandbox = new CspSandboxOptions(); }