fix: Add CORP and COEP headers to embedded pages (#15275)
* Add CORP headers * Improve test * Add unit tests as well --------- Co-authored-by: Keith Williams <[email protected]>
This commit is contained in:
1 parent
6e66f7f8f8
commit
37caa57798
12 files changed
+302
-21
No files matched your search
@@ -14,7 +14,10 @@ export default function withEmbedSsrAppDir<T extends Record<string, any>>(
|
||||
) {
|
||||
return async (context: GetServerSidePropsContext): Promise<T> => {
|
||||
const { embed, layout } = context.query;
|
||||
|
||||
const isCOEPEnabled = context.query["flag.coep"] === "true";
|
||||
if (isCOEPEnabled) {
|
||||
context.res.setHeader("Cross-Origin-Embedder-Policy", "require-corp");
|
||||
}
|
||||
try {
|
||||
const props = await getData(context);
|
||||
|
||||
|
||||
Reference in new issue
Block a user