dotnet / dotnet/aspnetcore

[API Proposal]: Add `CorsPolicyBuilder.AllowAnyExposedHeader`

Open
#57,546 0 comments 0 reactions 0 assignees View on GitHub
api-suggestion area-middleware feature-cors
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

## Background and Motivation

The header Access-Control-Expose-Headers supports wildcard as with other cors headers.

## Proposed API
```cs
namespace Microsoft.AspNetCore.Cors.Infrastructure;

public class CorsPolicyBuilder
{
+ public CorsPolicyBuilder AllowAnyExposedHeader();
}
```
## Usage Examples
```cs
policyBuilder.AllowAnyExposedHeader();
```

## Alternative Designs

## Risks

Just like `AnyOrigins` this is not gonna work with `AllowCredentials`. Perhaps an analyzer could flag misusage for both.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.