Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add connect img and frame csp directives #2910

Merged
merged 3 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 9 additions & 8 deletions .storybook/post-process-index-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,15 @@ function addCspTag(filePath) {
// const styleEndMatch = '</style>';
// readHashesForMatch(htmlDocument, styleMatch, styleEndMatch, styleHashes);

const cspTag = `<meta
http-equiv="Content-Security-Policy"
content="script-src-elem 'strict-dynamic' 'report-sample' ${hashes.join(
' '
)} 'self';style-src 'report-sample' 'unsafe-inline' ${styleHashes.join(
' '
)} 'self';font-src static2.sharepointonline.com 'self';default-src 'self'; base-uri 'self'; upgrade-insecure-requests; form-action 'self';report-to https://csp.microsoft.com/report/MGT-Playground"
/>`;
const cspTag = `
<meta
http-equiv="Content-Security-Policy"
content="script-src-elem 'strict-dynamic' 'report-sample' ${hashes.join(
' '
)} 'self';style-src 'report-sample' 'unsafe-inline' ${styleHashes.join(
' '
)} 'self';font-src static2.sharepointonline.com 'self';connect-src https://cdn.graph.office.net https://login.microsoftonline.com https://graph.microsoft.com https://mgt.dev 'self';img-src data: https: 'self';frame-src https://login.microsoftonline.com 'self';default-src 'self'; base-uri 'self'; upgrade-insecure-requests; form-action 'self';report-to https://csp.microsoft.com/report/MGT-Playground"
/>`;
const updatedHtmlDocument = htmlDocument.replace(
/<head>/,
`<head>
Expand Down
1 change: 0 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Microsoft Graph Toolkit Test</title>
<meta http-equiv="Content-Security-Policy" content="default-src 'self'">
<meta name="viewport" content="width=device-width, initial-scale=1" />

<link href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css" rel="stylesheet" />
Expand Down