fix base64 csp error #279
No reviewers
Labels
No Label
in progress
kind/bug
kind/deployment
kind/docs
kind/enhancement
kind/feature
kind/lint
kind/proposal
kind/question
kind/security
kind/testing
kind/translation
kind/ui
lgtm/done
lgtm/need 1
lgtm/need 2
priority/critical
priority/low
priority/maybe
priority/medium
reviewed/duplicate
reviewed/invalid
reviewed/wontfix
status/blocked
status/needs-feedback
status/wip
No Milestone
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: gitea/blog#279
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "HesterG:fix-base64-csp"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
patch for #276
The errors because some img src is converted to base64 by the framework (for some unknown reason, probably because of something like
url-loader
), which violetsimg-src 'self'
related CSP ruleThis PR explicitly use path as src for these images to fix this.
For long run, might need to find out why the framework turns the src into base64..
According to @yardenshoham, there's a configurable limit of bytes (10kb by default) below which docusaurus decides to inline the image instead of loading it externally.
We just need to set an env var WEBPACK_URL_LOADER_LIMIT=1, maybe in the Makefile?
Thanks! I found the PR for this, and also the code and I tried the followings:
WEBPACK_URL_LOADER_LIMIT=1
toMakefile
, and domake server
WEBPACK_URL_LOADER_LIMIT=1
to.env
file"start": "cross-env WEBPACK_URL_LOADER_LIMIT=1 docusaurus start --port 1313",
inpackage.json
But none of them worked.. Maybe i am still using it wrong. Do you have any idea about what is a proper way to do it?
I removed
node_modules
and donpm i
again, and then the environment variable works, so opened #280 to replace this PR.Pull request closed