Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
0f306ca5
Unverified
Commit
0f306ca5
authored
7 months ago
by
Uladzimir Havenchyk
Committed by
GitHub
7 months ago
Browse files
Options
Downloads
Patches
Plain Diff
fix CSP error in prod (#46890)
parent
28e5fac9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
frontend/src/metabase/app.js
+3
-0
3 additions, 0 deletions
frontend/src/metabase/app.js
frontend/src/metabase/dev.js
+0
-12
0 additions, 12 deletions
frontend/src/metabase/dev.js
frontend/src/metabase/lib/csp.js
+13
-0
13 additions, 0 deletions
frontend/src/metabase/lib/csp.js
with
16 additions
and
12 deletions
frontend/src/metabase/app.js
+
3
−
0
View file @
0f306ca5
...
...
@@ -24,6 +24,9 @@ import "metabase/plugins/builtin";
// If EE isn't enabled, it loads an empty file.
import
"
ee-plugins
"
;
// eslint-disable-line import/no-duplicates
// Set nonce for mantine v6 deps
import
"
metabase/lib/csp
"
;
import
{
createHistory
}
from
"
history
"
;
import
{
DragDropContextProvider
}
from
"
react-dnd
"
;
import
HTML5Backend
from
"
react-dnd-html5-backend
"
;
...
...
This diff is collapsed.
Click to expand it.
frontend/src/metabase/dev.js
+
0
−
12
View file @
0f306ca5
import
"
cljs/metabase.util.devtools
"
;
/**
* setNonce is required for react-remove-scroll which adds style and can handle
* nonce but the method we use to set nonce is not compatible with
* react-remove-scroll it expects __webpack_nonce__ to be defined, when we
* generate it at BE and put directly into html file. `get-nonce` is used inside
* react-remove-scroll to get nonce, so we put it manually here.
* react-remove-scroll is a dependency of mantine v6
*/
import
{
setNonce
}
from
"
get-nonce
"
;
setNonce
(
window
.
MetabaseNonce
);
This diff is collapsed.
Click to expand it.
frontend/src/metabase/lib/csp.js
0 → 100644
+
13
−
0
View file @
0f306ca5
/**
* setNonce is required for react-remove-scroll which adds style and can handle
* nonce but the method we use to set nonce is not compatible with
* react-remove-scroll it expects __webpack_nonce__ to be defined, when we
* generate it at BE and put directly into html file. `get-nonce` is used inside
* react-remove-scroll to get nonce, so we put it manually here.
* react-remove-scroll is a dependency of mantine v6
*
* TODO: remove it when we upgrade mantine to v7
*/
import
{
setNonce
}
from
"
get-nonce
"
;
setNonce
(
window
.
MetabaseNonce
);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment