Skip to content

fix: use invariant culture for vary-by ETag formatting#733

Merged
ascott18 merged 2 commits into
mainfrom
ascott18/fix-vary-invariant-culture
Jun 30, 2026
Merged

fix: use invariant culture for vary-by ETag formatting#733
ascott18 merged 2 commits into
mainfrom
ascott18/fix-vary-invariant-culture

Conversation

@ascott18

Copy link
Copy Markdown
Collaborator

Culture-sensitive ToString() in generated controllers can produce different vary-by ETag values depending on server culture. This makes cache validation inconsistent for non-string vary-by properties.

This change updates API controller generation to format non-string vary-by values with CultureInfo.InvariantCulture before UTF-8 encoding, so ETag computation is stable across cultures. It preserves existing behavior for byte-array and string vary-by properties and adds a changelog entry for the fix.

ascott18 and others added 2 commits June 18, 2026 23:02
Generate invariant-culture formatting when converting non-string vary-by values to bytes for ETag computation to avoid culture-dependent hashes in generated controllers.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ascott18 ascott18 merged commit c8c1805 into main Jun 30, 2026
17 checks passed
@ascott18 ascott18 deleted the ascott18/fix-vary-invariant-culture branch June 30, 2026 01:55
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.

1 participant