fix(api): use proper CSP hash for inline script in Swagger doc renderer#977
Conversation
A last-minute, seemingly inconspicuous, addition[^0] was made to danielgtaylor#916 which resulted in changing the CSP hash for the inline script, effectively breaking Swagger Web UI spec rendering. This change updates to the correct hash. [^0]: https://github.com/danielgtaylor/huma/compare/26af2c17e8cc3fca088c4a878611627c0389711a..b6a65071f8f3206a654dd37dabf2766ffab3e883
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #977 +/- ##
=======================================
Coverage 93.11% 93.11%
=======================================
Files 23 23
Lines 4766 4766
=======================================
Hits 4438 4438
Misses 269 269
Partials 59 59 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR fixes a critical bug in the Swagger UI documentation renderer where an incorrect CSP (Content Security Policy) hash was preventing the inline script from executing, effectively breaking the Swagger Web UI spec rendering. The issue was introduced by a last-minute change in PR #916 that updated the CSP hash to an incorrect value.
Changes:
- Updated the CSP sha256 hash for the inline script in the Swagger UI documentation renderer from an incorrect value to the correct one
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
This unfortunately warrants a new (hotfix) release, @wolveix :( |
|
@leonklingele yep, noted. Trying to get something else squeezed in before releasing! |
A last-minute, seemingly inconspicuous, addition1 was made to #916 which resulted in changing the CSP hash for the inline script, effectively breaking Swagger Web UI spec rendering. This change updates to the correct hash.
Footnotes
https://github.com/danielgtaylor/huma/compare/26af2c17e8cc3fca088c4a878611627c0389711a..b6a65071f8f3206a654dd37dabf2766ffab3e883 ↩