File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -6,11 +6,18 @@ import { SiweMessage } from 'siwe';
66
77const router = express . Router ( ) ;
88
9+ const customHeaders = ( res , path , stat ) => {
10+ res . append ( "Cross-Origin-Opener-Policy" , "same-origin-allow-popups" ) ;
11+ }
12+
913// Serve static files from the static directory
10- router . use ( express . static ( 'static' ) ) ;
14+ router . use ( express . static ( 'static' , { setHeaders : customHeaders } ) ) ;
1115
1216// Serve the main index.html file on the base route
1317router . get ( '/' , ( req , res ) => {
18+ // Try a different approach since previous methods didn't work
19+ // First send the header, then use a callback to send the file
20+ // res.header('Cross-Origin-Opener-Policy', 'same-origin-allow-popups');
1421 res . sendFile ( 'index.html' , { root : 'static' } ) ;
1522} ) ;
1623
You can’t perform that action at this time.
0 commit comments