Skip to content

fix(frontend-api): update cached frontend settings when updating CORS origins - #12615

Closed
Tyagiquamar wants to merge 1 commit into
Unleash:mainfrom
Tyagiquamar:fix/frontend-cors-cache-invalidation
Closed

fix(frontend-api): update cached frontend settings when updating CORS origins#12615
Tyagiquamar wants to merge 1 commit into
Unleash:mainfrom
Tyagiquamar:fix/frontend-cors-cache-invalidation

Conversation

@Tyagiquamar

Copy link
Copy Markdown

Summary

Fixes #12561

When setFrontendCorsSettings updates CORS origins in the database, it previously left this.cachedFrontendSettings with the stale pre-write settings fetched during validation. Consequently, subsequent calls to getFrontendSettings(true) (such as in CORS headers middleware) served outdated CORS configuration until the cache expired or was refreshed.

Changes

  • In FrontendApiService.setFrontendCorsSettings, assign the updated settings object to this.cachedFrontendSettings upon successful write.
  • Added unit test in frontend-api-service.test.ts verifying that setFrontendCorsSettings immediately updates cached settings.

@CLAassistant

CLAassistant commented Sep 6, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@Tyagiquamar

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@gastonfournier gastonfournier left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The issue reported is really low value, so I'll close it. Thanks for the contribution anyway, but I believe fixing this issue is not worthwhile

Comment thread src/lib/features/frontend-api/frontend-api-service.ts
@Tyagiquamar Tyagiquamar closed this Sep 7, 2026
@github-project-automation github-project-automation Bot moved this from New to Done in Issues and PRs Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Writing CORS origins caches the pre-write value, so a tightened CORS policy stays open for up to 2 minutes

3 participants