Skip to content
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

fix: System settings endpoint returns expected Cache-Control header v… #15888

Merged
merged 5 commits into from
Dec 11, 2023

Conversation

david-mackessy
Copy link
Contributor

@david-mackessy david-mackessy commented Dec 11, 2023

…alue DHIS2-15196

Summary

Security issue raised so that we set the following values for the Cache-Control header on the /api/systemSettings endpoint:

  • no-cache
  • no-store
  • must-revalidate

Code added to ContextUtils for easy reuse.

Note

This was the easiest and simplest way to have the combination of these 3 header values contained in 1 header key.
The Spring CacheControl class is not nice to work with at all when trying to get these 3 specific values together (mix of static and non-static methods)

Testing

Automated

  • e2e test added

Manual

  • make call to GET /api/systemSettings
  • check header Cache-Control
  • ensure its value is no-cache, no-store, must-revalidate

Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

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.

3 participants