Skip to content

Commit cf005da

Browse files
fix: Add Algolia domains to CSP config for DocSearch (#1082)
The Content-Security-Policy header was blocking Algolia DocSearch scripts and API requests, causing the search functionality to not work on the documentation site. This fix adds the required Algolia domains to both script-src and connect-src directives in the CSP header. Issue: Search functionality not working on pulsar.apache.org
1 parent e6c613e commit cf005da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

static/.htaccess

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ RewriteRule "^contributing/?$" "/contribute" [R=301,DPI,L]
3232
RewriteRule "^pulsar-manager-release-notes/?$" "/release-notes" [R=301,DPI,L]
3333

3434
<IfModule mod_headers.c>
35-
Header set Content-Security-Policy "script-src 'self' widget.kapa.ai www.google.com https://hcaptcha.com https://*.hcaptcha.com https://www.gstatic.com 'unsafe-inline' 'unsafe-eval'; connect-src 'self' proxy.kapa.ai kapa-widget-proxy-la7dkmplpq-uc.a.run.app metrics.kapa.ai https://hcaptcha.com https://*.hcaptcha.com www.google.com; frame-src 'self' www.google.com https://hcaptcha.com https://*.hcaptcha.com; style-src 'self' 'unsafe-inline' https://hcaptcha.com https://*.hcaptcha.com;"
35+
Header set Content-Security-Policy "script-src 'self' https://*.algolia.net https://*.algolianet.com https://*.algolia.io widget.kapa.ai www.google.com https://hcaptcha.com https://*.hcaptcha.com https://www.gstatic.com 'unsafe-inline' 'unsafe-eval'; connect-src 'self' https://*.algolia.net https://*.algolianet.com https://*.algolia.io proxy.kapa.ai kapa-widget-proxy-la7dkmplpq-uc.a.run.app metrics.kapa.ai https://hcaptcha.com https://*.hcaptcha.com www.google.com; frame-src 'self' www.google.com https://hcaptcha.com https://*.hcaptcha.com; style-src 'self' 'unsafe-inline' https://hcaptcha.com https://*.hcaptcha.com;"
3636
</IfModule>

0 commit comments

Comments
 (0)