Skip to content

Adds support for CORS for POST requests in CrudApiPlugin#1197

Merged
waldekmastykarz merged 3 commits intodotnet:mainfrom
waldekmastykarz:crudapi-cors2
May 22, 2025
Merged

Adds support for CORS for POST requests in CrudApiPlugin#1197
waldekmastykarz merged 3 commits intodotnet:mainfrom
waldekmastykarz:crudapi-cors2

Conversation

@waldekmastykarz
Copy link
Copy Markdown
Collaborator

No description provided.

@waldekmastykarz waldekmastykarz requested a review from a team as a code owner May 21, 2025 10:02
@garrytrinder garrytrinder requested a review from Copilot May 21, 2025 18:06
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for CORS for POST requests in the CrudApiPlugin by including content-type in the allowed headers when EntraAuthConfig is enabled.

  • Expands the CORS access-control-allow-headers value to include content-type
  • Applies change within the AddCORSHeaders method under Mocks/CrudApiPlugin.cs
Comments suppressed due to low confidence (1)

dev-proxy-plugins/Mocks/CrudApiPlugin.cs:223

  • Add or update unit tests to verify that the CORS response includes content-type alongside authorization when EntraAuthConfig is set, ensuring this change is covered and preventing future regressions.
headers.Add(new HttpHeader("access-control-allow-headers", "authorization, content-type"));

Comment thread dev-proxy-plugins/Mocks/CrudApiPlugin.cs Outdated
@waldekmastykarz waldekmastykarz enabled auto-merge (squash) May 22, 2025 05:59
@waldekmastykarz waldekmastykarz merged commit 6e423ac into dotnet:main May 22, 2025
4 checks passed
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