Skip to content

Commit 188722e

Browse files
authored
cors: add unmatched_preflights (#3171)
* cors: add forward_not_matching_preflights * rename * update with rama's comment * use Enum instead of bool * address john's suggestion
1 parent 200df04 commit 188722e

File tree

8 files changed

+845
-485
lines changed

8 files changed

+845
-485
lines changed

kubernetes/customresourcedefinitions.gen.yaml

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

networking/v1/virtual_service.pb.go

Lines changed: 236 additions & 159 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

networking/v1/virtual_service.proto

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1366,6 +1366,22 @@ message CorsPolicy {
13661366
// (not the preflight) using credentials. Translates to
13671367
// `Access-Control-Allow-Credentials` header.
13681368
google.protobuf.BoolValue allow_credentials = 6;
1369+
1370+
// Indicates whether preflight requests not matching the configured
1371+
// allowed origin shouldn't be forwarded to the upstream.
1372+
// Default is forward to upstream.
1373+
UnmatchedPreflights unmatched_preflights = 8;
1374+
1375+
enum UnmatchedPreflights {
1376+
// Default to FORWARD
1377+
UNSPECIFIED = 0;
1378+
// Preflight requests not matching the configured allowed origin
1379+
// will be forwarded to the upstream.
1380+
FORWARD = 1;
1381+
// Preflight requests not matching the configured allowed origin
1382+
// will not be forwarded to the upstream.
1383+
IGNORE = 2;
1384+
}
13691385
}
13701386

13711387
// HTTPFaultInjection can be used to specify one or more faults to inject

networking/v1alpha3/virtual_service.pb.go

Lines changed: 240 additions & 162 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

networking/v1alpha3/virtual_service.pb.html

Lines changed: 50 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

networking/v1alpha3/virtual_service.proto

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1367,6 +1367,22 @@ message CorsPolicy {
13671367
// (not the preflight) using credentials. Translates to
13681368
// `Access-Control-Allow-Credentials` header.
13691369
google.protobuf.BoolValue allow_credentials = 6;
1370+
1371+
// Indicates whether preflight requests not matching the configured
1372+
// allowed origin shouldn't be forwarded to the upstream.
1373+
// Default is forward to upstream.
1374+
UnmatchedPreflights unmatched_preflights = 8;
1375+
1376+
enum UnmatchedPreflights {
1377+
// Default to FORWARD
1378+
UNSPECIFIED = 0;
1379+
// Preflight requests not matching the configured allowed origin
1380+
// will be forwarded to the upstream.
1381+
FORWARD = 1;
1382+
// Preflight requests not matching the configured allowed origin
1383+
// will not be forwarded to the upstream.
1384+
IGNORE = 2;
1385+
}
13701386
}
13711387

13721388
// HTTPFaultInjection can be used to specify one or more faults to inject

0 commit comments

Comments
 (0)