You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
html { box-sizing: border-box; overflow-y: scroll; }
*, *:after, *:before { box-sizing: inherit; }
body { background: #fafafa; margin: 0; }
</style>
the following error is displayed in the console:
Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self'".
Either the 'unsafe-inline' keyword, a hash ('sha256-MMpT0iDxyjALd9PdfepImGX3DBfJPXZ4IlDWdPAgtn0='), or a nonce ('nonce-...') is required to enable inline execution.
That there was no CSP error, so that the CSS styles could be applied.
From what I can tell, this can be solved either by moving the CSS styles linked above to its own .css file and serve it like the other Swagger files are served with drf-spectacular-sidecar, or by implementing hash or nonce support, like the console error from Chrome suggests - the latter of which is also suggested in #1241.
The text was updated successfully, but these errors were encountered:
Describe the bug
When visiting the Swagger UI page and my browser (Chromium 128.0.6613.85) parses this inline styling:
drf-spectacular/drf_spectacular/templates/drf_spectacular/swagger_ui.html
Lines 10 to 14 in 2b4d5ab
the following error is displayed in the console:
To Reproduce
We use django-csp and drf-spectacular-sidecar with the following settings:
Click to expand
Expected behavior
That there was no CSP error, so that the CSS styles could be applied.
From what I can tell, this can be solved either by moving the CSS styles linked above to its own
.css
file and serve it like the other Swagger files are served with drf-spectacular-sidecar, or by implementing hash or nonce support, like the console error from Chrome suggests - the latter of which is also suggested in #1241.The text was updated successfully, but these errors were encountered: