Skip to content

Reject malformed accept header values#199

Merged
kukushechkin merged 2 commits into
apple:mainfrom
kukushechkin:gracefully-handle-invalid-headers
Jun 17, 2026
Merged

Reject malformed accept header values#199
kukushechkin merged 2 commits into
apple:mainfrom
kukushechkin:gracefully-handle-invalid-headers

Conversation

@kukushechkin

Copy link
Copy Markdown
Contributor

Motivation

Swift OpenAPI Runtime crashes if receives a malformed accept header value consisting of just ";".

Modifications

  • Throw if accept header value if malformed and only contains ";".
  • Add malformed header values to tests.

Result

Swift OpenAPI Runtime no longer crashes if receives a malformed accept header value consisting of just ";".

Test Plan

Cover all the throws in validateAcceptIfPresent.

@kukushechkin kukushechkin added the 🔨 semver/patch No public API change. label Jun 17, 2026
@kukushechkin kukushechkin merged commit d6f83f2 into apple:main Jun 17, 2026
50 of 51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 semver/patch No public API change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants