clickjacking protection: set X-Frame-Options SAMEORIGIN, RT#39607
authorIvan Kohler <ivan@freeside.biz>
Tue, 5 Jan 2016 17:09:08 +0000 (09:09 -0800)
committerIvan Kohler <ivan@freeside.biz>
Tue, 5 Jan 2016 17:09:08 +0000 (09:09 -0800)
FS/FS/Mason/Request.pm

index 2cf1ed9..b33efcc 100644 (file)
@@ -65,6 +65,10 @@ sub freeside_setup {
             if fileno(STDOUT) != 1;
     }
 
+    FS::Trace->log('    adding headers');
+    #frame-ancestors not supported by all the major browsers yet
+    $HTML::Mason::Commands::r->header_out( 'X-Frame-Options', 'SAMEORIGIN' );
+
     if ( $filename =~ qr(/REST/\d+\.\d+/NoAuth/) ) {
 
       FS::Trace->log('    handling RT REST/NoAuth file');