mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 19:23:40 +00:00
use case-insensitive header keys for http probes
This commit is contained in:
parent
ad18954259
commit
10a8ec5b2c
2
api/openapi-spec/swagger.json
generated
2
api/openapi-spec/swagger.json
generated
@ -6192,7 +6192,7 @@
|
||||
"description": "HTTPHeader describes a custom header to be used in HTTP probes",
|
||||
"properties": {
|
||||
"name": {
|
||||
"description": "The header field name",
|
||||
"description": "The header field name. This will be canonicalized upon output, so case-variant names will be understood as the same header.",
|
||||
"type": "string"
|
||||
},
|
||||
"value": {
|
||||
|
@ -2632,7 +2632,7 @@
|
||||
"properties": {
|
||||
"name": {
|
||||
"default": "",
|
||||
"description": "The header field name",
|
||||
"description": "The header field name. This will be canonicalized upon output, so case-variant names will be understood as the same header.",
|
||||
"type": "string"
|
||||
},
|
||||
"value": {
|
||||
|
@ -2568,7 +2568,7 @@
|
||||
"properties": {
|
||||
"name": {
|
||||
"default": "",
|
||||
"description": "The header field name",
|
||||
"description": "The header field name. This will be canonicalized upon output, so case-variant names will be understood as the same header.",
|
||||
"type": "string"
|
||||
},
|
||||
"value": {
|
||||
|
@ -1859,7 +1859,7 @@
|
||||
"properties": {
|
||||
"name": {
|
||||
"default": "",
|
||||
"description": "The header field name",
|
||||
"description": "The header field name. This will be canonicalized upon output, so case-variant names will be understood as the same header.",
|
||||
"type": "string"
|
||||
},
|
||||
"value": {
|
||||
|
@ -2037,7 +2037,8 @@ type SecretEnvSource struct {
|
||||
|
||||
// HTTPHeader describes a custom header to be used in HTTP probes
|
||||
type HTTPHeader struct {
|
||||
// The header field name
|
||||
// The header field name.
|
||||
// This will be canonicalized upon output, so case-variant names will be understood as the same header.
|
||||
Name string
|
||||
// The header field value
|
||||
Value string
|
||||
|
2
pkg/generated/openapi/zz_generated.openapi.go
generated
2
pkg/generated/openapi/zz_generated.openapi.go
generated
@ -19979,7 +19979,7 @@ func schema_k8sio_api_core_v1_HTTPHeader(ref common.ReferenceCallback) common.Op
|
||||
Properties: map[string]spec.Schema{
|
||||
"name": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "The header field name",
|
||||
Description: "The header field name. This will be canonicalized upon output, so case-variant names will be understood as the same header.",
|
||||
Default: "",
|
||||
Type: []string{"string"},
|
||||
Format: "",
|
||||
|
@ -113,7 +113,7 @@ func formatURL(scheme string, host string, port int, path string) *url.URL {
|
||||
func v1HeaderToHTTPHeader(headerList []v1.HTTPHeader) http.Header {
|
||||
headers := make(http.Header)
|
||||
for _, header := range headerList {
|
||||
headers[header.Name] = append(headers[header.Name], header.Value)
|
||||
headers.Add(header.Name, header.Value)
|
||||
}
|
||||
return headers
|
||||
}
|
||||
|
@ -64,6 +64,17 @@ func Test_v1HeaderToHTTPHeader(t *testing.T) {
|
||||
"Accept-Ranges": {"bytes"},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "case insensitive",
|
||||
headerList: []v1.HTTPHeader{
|
||||
{Name: "HOST", Value: "example.com"},
|
||||
{Name: "FOO-bAR", Value: "value"},
|
||||
},
|
||||
want: http.Header{
|
||||
"Host": {"example.com"},
|
||||
"Foo-Bar": {"value"},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "empty input",
|
||||
headerList: []v1.HTTPHeader{},
|
||||
|
@ -1853,7 +1853,8 @@ message HTTPGetAction {
|
||||
|
||||
// HTTPHeader describes a custom header to be used in HTTP probes
|
||||
message HTTPHeader {
|
||||
// The header field name
|
||||
// The header field name.
|
||||
// This will be canonicalized upon output, so case-variant names will be understood as the same header.
|
||||
optional string name = 1;
|
||||
|
||||
// The header field value
|
||||
|
@ -2137,7 +2137,8 @@ type SecretEnvSource struct {
|
||||
|
||||
// HTTPHeader describes a custom header to be used in HTTP probes
|
||||
type HTTPHeader struct {
|
||||
// The header field name
|
||||
// The header field name.
|
||||
// This will be canonicalized upon output, so case-variant names will be understood as the same header.
|
||||
Name string `json:"name" protobuf:"bytes,1,opt,name=name"`
|
||||
// The header field value
|
||||
Value string `json:"value" protobuf:"bytes,2,opt,name=value"`
|
||||
|
@ -832,7 +832,7 @@ func (HTTPGetAction) SwaggerDoc() map[string]string {
|
||||
|
||||
var map_HTTPHeader = map[string]string{
|
||||
"": "HTTPHeader describes a custom header to be used in HTTP probes",
|
||||
"name": "The header field name",
|
||||
"name": "The header field name. This will be canonicalized upon output, so case-variant names will be understood as the same header.",
|
||||
"value": "The header field value",
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user