Skip to content

Commit

Permalink
api: Add support for enabling HTTP/1.0 and HTTP/0.9 (#2534)
Browse files Browse the repository at this point in the history
* api: Add support for enabling HTTP/1.0 and HTTP/0.9

Signed-off-by: Lior Okman <[email protected]>

* Aligned the api with the reviews

Signed-off-by: Lior Okman <[email protected]>

* Aligned the api with the reviews.

Signed-off-by: Lior Okman <[email protected]>

---------

Signed-off-by: Lior Okman <[email protected]>
  • Loading branch information
liorokman authored Feb 8, 2024
1 parent dc4a8d3 commit 151ae6a
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 0 deletions.
14 changes: 14 additions & 0 deletions api/v1alpha1/clienttrafficpolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,20 @@ type HTTP1Settings struct {
// By default, Envoy will lowercase all the headers.
// +optional
PreserveHeaderCase *bool `json:"preserveHeaderCase,omitempty"`
// HTTP10 turns on support for HTTP/1.0 and HTTP/0.9 requests.
// +optional
HTTP10 *HTTP10Settings `json:"http10,omitempty"`
}

// HTTP10Settings provides HTTP/1.0 configuration on the listener.
type HTTP10Settings struct {
// UseDefaultHost defines if the HTTP/1.0 request is missing the Host header,
// then the hostname associated with the listener should be injected into the
// request.
// If this is not set and an HTTP/1.0 request arrives without a host, then
// it will be rejected.
// +optional
UseDefaultHost *bool `json:"useDefaultHost,omitempty"`
}

// ClientTrafficPolicyStatus defines the state of ClientTrafficPolicy
Expand Down
25 changes: 25 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,18 @@ spec:
description: EnableTrailers defines if HTTP/1 trailers should
be proxied by Envoy.
type: boolean
http10:
description: HTTP10 turns on support for HTTP/1.0 and HTTP/0.9
requests.
properties:
useDefaultHost:
description: UseDefaultHost defines if the HTTP/1.0 request
is missing the Host header, then the hostname associated
with the listener should be injected into the request. If
this is not set and an HTTP/1.0 request arrives without
a host, then it will be rejected.
type: boolean
type: object
preserveHeaderCase:
description: PreserveHeaderCase defines if Envoy should preserve
the letter case of headers. By default, Envoy will lowercase
Expand Down
15 changes: 15 additions & 0 deletions site/content/en/latest/api/extension_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,20 @@ _Appears in:_



#### HTTP10Settings



HTTP10Settings provides HTTP/1.0 configuration on the listener.

_Appears in:_
- [HTTP1Settings](#http1settings)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `useDefaultHost` | _boolean_ | false | UseDefaultHost defines if the HTTP/1.0 request is missing the Host header, then the hostname associated with the listener should be injected into the request. If this is not set and an HTTP/1.0 request arrives without a host, then it will be rejected. |


#### HTTP1Settings


Expand All @@ -1084,6 +1098,7 @@ _Appears in:_
| --- | --- | --- | --- |
| `enableTrailers` | _boolean_ | false | EnableTrailers defines if HTTP/1 trailers should be proxied by Envoy. |
| `preserveHeaderCase` | _boolean_ | false | PreserveHeaderCase defines if Envoy should preserve the letter case of headers. By default, Envoy will lowercase all the headers. |
| `http10` | _[HTTP10Settings](#http10settings)_ | false | HTTP10 turns on support for HTTP/1.0 and HTTP/0.9 requests. |


#### HTTP3Settings
Expand Down

0 comments on commit 151ae6a

Please sign in to comment.