mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	Merge pull request #114606 from tuunit/bugfix-case-sensitive-headers
fix: remove case sensitive checking of probe headers
This commit is contained in:
		@@ -89,3 +89,49 @@ func Test_v1HeaderToHTTPHeader(t *testing.T) {
 | 
				
			|||||||
		})
 | 
							})
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func TestHeaderConversion(t *testing.T) {
 | 
				
			||||||
 | 
						testCases := []struct {
 | 
				
			||||||
 | 
							headers  []v1.HTTPHeader
 | 
				
			||||||
 | 
							expected http.Header
 | 
				
			||||||
 | 
						}{
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								[]v1.HTTPHeader{
 | 
				
			||||||
 | 
									{
 | 
				
			||||||
 | 
										Name:  "Accept",
 | 
				
			||||||
 | 
										Value: "application/json",
 | 
				
			||||||
 | 
									},
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								http.Header{
 | 
				
			||||||
 | 
									"Accept": []string{"application/json"},
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								[]v1.HTTPHeader{
 | 
				
			||||||
 | 
									{Name: "accept", Value: "application/json"},
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								http.Header{
 | 
				
			||||||
 | 
									"Accept": []string{"application/json"},
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								[]v1.HTTPHeader{
 | 
				
			||||||
 | 
									{Name: "accept", Value: "application/json"},
 | 
				
			||||||
 | 
									{Name: "Accept", Value: "*/*"},
 | 
				
			||||||
 | 
									{Name: "pragma", Value: "no-cache"},
 | 
				
			||||||
 | 
									{Name: "X-forwarded-for", Value: "username"},
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
								http.Header{
 | 
				
			||||||
 | 
									"Accept":          []string{"application/json", "*/*"},
 | 
				
			||||||
 | 
									"Pragma":          []string{"no-cache"},
 | 
				
			||||||
 | 
									"X-Forwarded-For": []string{"username"},
 | 
				
			||||||
 | 
								},
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						for _, test := range testCases {
 | 
				
			||||||
 | 
							headers := v1HeaderToHTTPHeader(test.headers)
 | 
				
			||||||
 | 
							if !reflect.DeepEqual(headers, test.expected) {
 | 
				
			||||||
 | 
								t.Errorf("Expected %v, got %v", test.expected, headers)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user