Skip to content

csp policy fix for worker #1926

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions kairon/actions/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
.style_src("'self'", "https:", "'unsafe-inline'")
.img_src("'self'", "https:")
.script_src("'self'", "https:", "'unsafe-inline'")
.worker_src("'self'", "blob:")
)
cache_value = CacheControl().must_revalidate()
content = XContentTypeOptions()
Expand Down
1 change: 1 addition & 0 deletions kairon/api/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
.style_src("'self'", "https:", "'unsafe-inline'")
.img_src("'self'", "https:")
.script_src("'self'", "https:", "'unsafe-inline'")
.worker_src("'self'", "blob:")
)
cache_value = CacheControl().must_revalidate()
content = XContentTypeOptions()
Expand Down
1 change: 1 addition & 0 deletions kairon/async_callback/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ async def shutdown(app: Application):
.connect_src("'self' api.spam.com")
.frame_src("'self'")
.img_src("'self'", "static.spam.com")
.worker_src("'self'", "blob:")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Ensure CSP builder and manual config are in sync with worker-src
The worker_src("'self'", "blob:") directive was added to the CSP builder chain, but the csp_config used by generate_csp_header lacks a corresponding "worker-src" entry. Add "worker-src": ["'self'", "blob:"] to csp_config to maintain consistency.

)
cache_value = CacheControl().must_revalidate()
content = XContentTypeOptions()
Expand Down
1 change: 1 addition & 0 deletions kairon/chat/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
.style_src("'self'", "https:", "'unsafe-inline'")
.img_src("'self'", "https:")
.script_src("'self'", "https:", "'unsafe-inline'")
.worker_src("'self'", "blob:")
)
cache_value = CacheControl().must_revalidate()
content = XContentTypeOptions()
Expand Down
1 change: 1 addition & 0 deletions kairon/evaluator/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
.connect_src("'self'" "api.spam.com")
.frame_src("'self'")
.img_src("'self'", "static.spam.com")
.worker_src("'self'", "blob:")
)
cache_value = CacheControl().must_revalidate()
content = XContentTypeOptions()
Expand Down
1 change: 1 addition & 0 deletions kairon/events/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
.style_src("'self'", "https:", "'unsafe-inline'")
.img_src("'self'", "https:")
.script_src("'self'", "https:", "'unsafe-inline'")
.worker_src("'self'", "blob:")
)
cache_value = CacheControl().must_revalidate()
content = XContentTypeOptions()
Expand Down
1 change: 1 addition & 0 deletions kairon/history/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
.connect_src("'self'" "api.spam.com")
.frame_src("'self'")
.img_src("'self'", "static.spam.com")
.worker_src("'self'", "blob:")
)
cache_value = CacheControl().must_revalidate()
content = XContentTypeOptions()
Expand Down
Loading