Beispiel #1
0
 public FrameGuard(RequestDelegate next, FrameGuardOptions options)
 {
     this.next    = next;
     this.options = options;
     if (options == null)
     {
         throw new ArgumentNullException(nameof(options));
     }
 }
Beispiel #2
0
        public static IApplicationBuilder UseFrameGuard(this IApplicationBuilder app, FrameGuardOptions options)
        {
            if (app == null)
            {
                throw new ArgumentNullException(nameof(app));
            }

            return(app.UseMiddleware <Middleware.FrameGuard>(options));
        }
Beispiel #3
0
 public FrameGuard(RequestDelegate next, FrameGuardOptions options)
 {
     _next    = next;
     _options = options ?? throw new ArgumentNullException(nameof(options));
 }
Beispiel #4
0
 /// <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);