Skip to content

Commit 8a8b4e7

Browse files
authored
Merge pull request #475 from nak3/add-set
Add Set field to HTTPRequestHeaderFilter
2 parents aff8301 + f58f741 commit 8a8b4e7

File tree

5 files changed

+114
-26
lines changed

5 files changed

+114
-26
lines changed

apis/v1alpha1/httproute_types.go

+27-6
Original file line numberDiff line numberDiff line change
@@ -432,18 +432,39 @@ const (
432432
// HTTPRequestHeaderFilter defines configuration for the RequestHeaderModifier
433433
// filter.
434434
type HTTPRequestHeaderFilter struct {
435-
// Add adds the given header (name, value) to the request
435+
// Set overwrites the request with the given header (name, value)
436436
// before the action.
437437
//
438438
// Input:
439439
// GET /foo HTTP/1.1
440+
// my-header: foo
441+
//
442+
// Config:
443+
// set: {"my-header": "bar"}
444+
//
445+
// Output:
446+
// GET /foo HTTP/1.1
447+
// my-header: bar
448+
//
449+
// Support: Extended
450+
// +optional
451+
Set map[string]string `json:"set,omitempty"`
452+
453+
// Add adds the given header (name, value) to the request
454+
// before the action. It appends to any existing values associated
455+
// with the header name.
456+
//
457+
// Input:
458+
// GET /foo HTTP/1.1
459+
// my-header: foo
440460
//
441461
// Config:
442-
// add: {"my-header": "foo"}
462+
// add: {"my-header": "bar"}
443463
//
444464
// Output:
445465
// GET /foo HTTP/1.1
446466
// my-header: foo
467+
// my-header: bar
447468
//
448469
// Support: Extended
449470
// +optional
@@ -456,16 +477,16 @@ type HTTPRequestHeaderFilter struct {
456477
//
457478
// Input:
458479
// GET /foo HTTP/1.1
459-
// My-Header1: ABC
460-
// My-Header2: DEF
461-
// My-Header2: GHI
480+
// my-header1: foo
481+
// my-header2: bar
482+
// my-header3: baz
462483
//
463484
// Config:
464485
// remove: ["my-header1", "my-header3"]
465486
//
466487
// Output:
467488
// GET /foo HTTP/1.1
468-
// My-Header2: DEF
489+
// my-header2: bar
469490
//
470491
// Support: Extended
471492
// +optional

apis/v1alpha1/zz_generated.deepcopy.go

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/networking.x-k8s.io_httproutes.yaml

+14-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs-src/spec.md

+33-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/spec/index.html

+33-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)