Closed nyxi closed 1 year ago
Custom headers added with SetCustomHeaders should be added to all requests made with the client.
The custom headers added with SetCustomHeaders are not added to requests made with the client.
vault-client-go 0.4.0
package main import ( "context" "fmt" "log" "net/http" "github.com/hashicorp/vault-client-go" "github.com/hashicorp/vault-client-go/schema" ) func handler(w http.ResponseWriter, r *http.Request) { fmt.Printf("Accept-Encoding: %s\n", r.Header.Get("accept-encoding")) fmt.Printf("Amazing: %s\n", r.Header.Get("amazing")) } func listen() { http.HandleFunc("/", http.HandlerFunc(handler)) http.ListenAndServe(":9393", nil) } func main() { go listen() // Get a Vault client client, _ := vault.New( vault.WithAddress("http://localhost:9393"), ) headers := make(http.Header) headers.Set("amazing", "very") err := client.SetCustomHeaders(headers) if err != nil { log.Fatalln(err) } _, _ = client.Auth.JwtOidcRequestAuthorizationUrl( context.Background(), schema.JwtOidcRequestAuthorizationUrlRequest{ RedirectUri: "http://localhost:9393/oidc/callback", Role: "default_role", }, vault.WithCustomHeaders(headers), ) }
Hi @nyxi, thanks for reporting this bug!
Somehow the wiring was never done for custom headers. I believe I have a fix for this in #237
Fixed and released in 0.4.1. Thanks again!
Expected Behavior
Custom headers added with SetCustomHeaders should be added to all requests made with the client.
Current Behavior
The custom headers added with SetCustomHeaders are not added to requests made with the client.
Failure Information
vault-client-go 0.4.0
Steps to Reproduce