Skip to content

nginx/csp: allow favicons for backend requests#1854

Merged
alxndrsn merged 15 commits into
getodk:nextfrom
alxndrsn:enable-csp-backend
Apr 30, 2026
Merged

nginx/csp: allow favicons for backend requests#1854
alxndrsn merged 15 commits into
getodk:nextfrom
alxndrsn:enable-csp-backend

Conversation

@alxndrsn
Copy link
Copy Markdown
Contributor

@alxndrsn alxndrsn commented Apr 28, 2026

Closes #1851

What has been done to verify that this works as intended?

  • updated tests
  • tested in dev

Why is this the best possible solution? Were any other approaches considered?

  • blanket policy for all backend responses
  • ultimately should be moved to Content-Security-Policy instead of Content-Security-Policy-Report-Only, at which point care will need to be taken to ensure it's only set if no Content-Security-Policy is provided by odk-central-backend.

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

  • No visible effect or risk of regression - currently report only.
  • Should prevent img-src CSP violation reports being sent for favicon.ico requests, reducing users' bandwidth if they ever encountered this.
  • Relaxation of current policy, so should not block previously-available content.

Does this change require updates to documentation? If so, please file an issue here and include the link below.

No.

Before submitting this PR, please make sure you have:

  • branched off and targeted the next branch OR only changed documentation/infrastructure (master is stable and used in production)
  • verified that any code or assets from external sources are properly credited in comments or that everything is internally sourced

Comment thread files/nginx/odk.conf.template Outdated
Comment thread test/nginx/src/mocha/nginx.spec.js Outdated
Comment thread test/nginx/src/mocha/nginx.spec.js Outdated
Co-authored-by: Alex Anderson <191496+alxndrsn@users.noreply.github.com>
Comment thread test/nginx/src/mocha/nginx.spec.js Outdated
Comment thread files/nginx/odk.conf.template Outdated
Comment thread files/nginx/odk.conf.template Outdated
Comment thread files/nginx/odk.conf.template Outdated
Comment thread test/nginx/src/mocha/nginx.spec.js Outdated
@alxndrsn alxndrsn marked this pull request as ready for review April 28, 2026 11:25
@matthew-white matthew-white linked an issue Apr 29, 2026 that may be closed by this pull request
Comment thread test/nginx/src/mocha/nginx.spec.js
@alxndrsn alxndrsn requested a review from matthew-white April 29, 2026 11:28
alxndrsn added a commit that referenced this pull request Apr 30, 2026
@alxndrsn alxndrsn merged commit c9b359a into getodk:next Apr 30, 2026
6 checks passed
@alxndrsn alxndrsn deleted the enable-csp-backend branch April 30, 2026 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

csp: block all except favicon for XML endpoints

2 participants