File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 22
33public static class SecurityHeadersDefinitions
44{
5+ private static HeaderPolicyCollection ? policy ;
6+
57 public static HeaderPolicyCollection GetHeaderPolicyCollection ( bool isDev , string ? idpHost )
68 {
79 ArgumentNullException . ThrowIfNull ( idpHost ) ;
810
9- var policy = new HeaderPolicyCollection ( )
11+ // Avoid building a new HeaderPolicyCollection on every request for performance reasons.
12+ // Where possible, cache and reuse HeaderPolicyCollection instances.
13+ if ( policy != null ) return policy ;
14+
15+ policy = new HeaderPolicyCollection ( )
1016 . AddFrameOptionsDeny ( )
1117 . AddContentTypeOptionsNoSniff ( )
1218 . AddReferrerPolicyStrictOriginWhenCrossOrigin ( )
Original file line number Diff line number Diff line change 1919 "editor.defaultFormatter" : " esbenp.prettier-vscode"
2020 },
2121 "editor.codeActionsOnSave" : {
22- "source.organizeImports" : true ,
23- "source.fixAll.eslint" : true
22+ "source.organizeImports" : " explicit " ,
23+ "source.fixAll.eslint" : " explicit "
2424 },
2525 "editor.formatOnSave" : true ,
26- "editor.formatOnPaste" : true ,
27-
26+ "editor.formatOnPaste" : true
2827}
You can’t perform that action at this time.
0 commit comments