Skip to content

Commit ed16f00

Browse files
committed
Update HTTPCORSFilter struct
This updates the Go struct in accordance with the GEP changes from #4281 At the same time, I'm slightly adjusting the wording of the GEP itself.
1 parent d0a4976 commit ed16f00

File tree

2 files changed

+26
-15
lines changed

2 files changed

+26
-15
lines changed

apis/v1/httproute_types.go

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,10 +1391,9 @@ type HTTPCORSFilter struct {
13911391
// the CORS headers. The cross-origin request fails on the client side.
13921392
// Therefore, the client doesn't attempt the actual cross-origin request.
13931393
//
1394-
// The `Access-Control-Allow-Origin` response header can only use `*`
1395-
// wildcard as value when the `AllowCredentials` field is false or omitted.
1396-
//
1397-
// When the `AllowCredentials` field is true and `AllowOrigins` field
1394+
// When the request is credentialed, the gateway must not specify the `*`
1395+
// wildcard in the `Access-Control-Allow-Origin` response header. When
1396+
// also the `AllowCredentials` field is true and `AllowOrigins` field
13981397
// specified with the `*` wildcard, the gateway must return a single origin
13991398
// in the value of the `Access-Control-Allow-Origin` response header,
14001399
// instead of specifying the `*` wildcard. The value of the header
@@ -1452,15 +1451,19 @@ type HTTPCORSFilter struct {
14521451
// The `Access-Control-Allow-Methods` response header can only use `*`
14531452
// wildcard as value when the `AllowCredentials` field is false or omitted.
14541453
//
1455-
// When the `AllowCredentials` field is true and `AllowMethods` field
1454+
// When the request is credentialed, the gateway must not specify the `*`
1455+
// wildcard in the `Access-Control-Allow-Methods` response header. When
1456+
// also the `AllowCredentials` field is true and `AllowMethods` field
14561457
// specified with the `*` wildcard, the gateway must specify one HTTP method
14571458
// in the value of the Access-Control-Allow-Methods response header. The
14581459
// value of the header `Access-Control-Allow-Methods` is same as the
14591460
// `Access-Control-Request-Method` header provided by the client. If the
14601461
// header `Access-Control-Request-Method` is not included in the request,
14611462
// the gateway will omit the `Access-Control-Allow-Methods` response header,
1462-
// instead of specifying the `*` wildcard. A Gateway implementation may
1463-
// choose to add implementation-specific default methods.
1463+
// instead of specifying the `*` wildcard.
1464+
//
1465+
// A Gateway implementation may choose to add implementation-specific
1466+
// default methods.
14641467
//
14651468
// Support: Extended
14661469
//
@@ -1495,15 +1498,19 @@ type HTTPCORSFilter struct {
14951498
// The `Access-Control-Allow-Headers` response header can only use `*`
14961499
// wildcard as value when the `AllowCredentials` field is false or omitted.
14971500
//
1498-
// When the `AllowCredentials` field is true and `AllowHeaders` field
1501+
// When the request is credentialed, the gateway must not specify the `*`
1502+
// wildcard in the `Access-Control-Allow-Headers` response header. When
1503+
// also the `AllowCredentials` field is true and `AllowHeaders` field
14991504
// specified with the `*` wildcard, the gateway must specify one or more
15001505
// HTTP headers in the value of the `Access-Control-Allow-Headers` response
15011506
// header. The value of the header `Access-Control-Allow-Headers` is same as
15021507
// the `Access-Control-Request-Headers` header provided by the client. If
15031508
// the header `Access-Control-Request-Headers` is not included in the
15041509
// request, the gateway will omit the `Access-Control-Allow-Headers`
1505-
// response header, instead of specifying the `*` wildcard. A Gateway
1506-
// implementation may choose to add implementation-specific default headers.
1510+
// response header, instead of specifying the `*` wildcard.
1511+
//
1512+
// A Gateway implementation may choose to add implementation-specific
1513+
// default headers.
15071514
//
15081515
// Support: Extended
15091516
//
@@ -1539,7 +1546,7 @@ type HTTPCORSFilter struct {
15391546
//
15401547
// A wildcard indicates that the responses with all HTTP headers are exposed
15411548
// to clients. The `Access-Control-Expose-Headers` response header can only
1542-
// use `*` wildcard as value when the `AllowCredentials` field is false or omitted.
1549+
// use `*` wildcard as value when the request is not credentialed.
15431550
//
15441551
// Support: Extended
15451552
//

geps/gep-1767/index.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,10 @@ type HTTPCORSFilter struct {
338338
// Output:
339339
// Access-Control-Allow-Methods: *
340340
//
341-
// When the `allowCredentials` config field is true and the request is
342-
// credentialed, the gateway must specify one
341+
// When the request is credentialed, the gateway must not specify the `*`
342+
// wildcard in the `Access-Control-Allow-Methods` response header. When
343+
// also the `AllowCredentials` field is true and `AllowMethods` field
344+
// specified with the `*` wildcard, the gateway must specify one
343345
// HTTP method in the value of the Access-Control-Allow-Methods response
344346
// header. The value of the header `Access-Control-Allow-Methods` is same
345347
// as the `Access-Control-Request-Method` header provided by the client.
@@ -414,8 +416,10 @@ type HTTPCORSFilter struct {
414416
// Output:
415417
// Access-Control-Allow-Headers: *
416418
//
417-
// When the `allowHeaders` config field contains the "*" wildcard and the request
418-
// is credentialed, the gateway must specify one or more
419+
// When the request is credentialed, the gateway must not specify the `*`
420+
// wildcard in the `Access-Control-Allow-Headers` response header. When
421+
// also the `AllowCredentials` field is true and the `AllowHeaders` field
422+
// is specified with the `*` wildcard, the gateway must specify one or more
419423
// HTTP headers in the value of the `Access-Control-Allow-Headers` response
420424
// header. The value of the header `Access-Control-Allow-Headers` is same as
421425
// the `Access-Control-Request-Headers` header provided by the client. If

0 commit comments

Comments
 (0)