public FrameGuard(RequestDelegate next, FrameGuardOptions options) { this.next = next; this.options = options; if (options == null) { throw new ArgumentNullException(nameof(options)); } }
public static IApplicationBuilder UseFrameGuard(this IApplicationBuilder app, FrameGuardOptions options) { if (app == null) { throw new ArgumentNullException(nameof(app)); } return(app.UseMiddleware <Middleware.FrameGuard>(options)); }
public FrameGuard(RequestDelegate next, FrameGuardOptions options) { _next = next; _options = options ?? throw new ArgumentNullException(nameof(options)); }
/// <summary> /// The X-Frame-Options HTTP response header can be used to indicate whether or not a browser should be allowed to render a page in a frame, iframe, or object . Sites can use this to avoid clickjacking attacks, by ensuring that their content is not embedded into other sites. /// </summary> /// <param name="app"></param> /// <param name="options"></param> /// <returns></returns> public static IApplicationBuilder UseFrameGuard(this IApplicationBuilder app, FrameGuardOptions options) => app.UseMiddleware <FrameGuard>(options);