Skip to content

Commit

Permalink
docs(apigateway): fix doc of Vary header for allowOrigins (#33519)
Browse files Browse the repository at this point in the history
### Issue # (if applicable)

### Reason for this change



The doc of `Vary` header for `allowOrigins` seems to be wrong. It will be included if it is not `Cors.ALL_ORIGINS`.

> If Cors.ALL_ORIGINS is specified, the Vary: Origin response header will also be included.

see:

https://github.com/go-to-k/aws-cdk/blob/9154927fa0959238c4ddf9ba807cc912fa05a5e6/packages/aws-cdk-lib/aws-apigateway/lib/resource.ts#L224

### Description of changes



Change to:

> If specific origins are specified (not `Cors.ALL_ORIGINS`), the `Vary: Origin` response header will also be included.

### Describe any new or updated permissions being added




### Description of how you validated changes



### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
go-to-k authored Feb 20, 2025
1 parent be3bce3 commit 8728d5b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/aws-cdk-lib/aws-apigateway/lib/cors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export interface CorsOptions {
* `[ * ]`.
*
* Responses will include the `Access-Control-Allow-Origin` response header.
* If `Cors.ALL_ORIGINS` is specified, the `Vary: Origin` response header will
* also be included.
* If specific origins are specified (not `Cors.ALL_ORIGINS`), the `Vary: Origin`
* response header will also be included.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin
*/
Expand Down

0 comments on commit 8728d5b

Please sign in to comment.