We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent efb7d71 commit 4b4a494Copy full SHA for 4b4a494
1 file changed
client.go
@@ -7,6 +7,7 @@ import (
7
"net/http"
8
"os"
9
"slices"
10
+ "strings"
11
12
"github.com/kernel/hypeman-go/internal/requestconfig"
13
"github.com/kernel/hypeman-go/option"
@@ -38,6 +39,14 @@ func DefaultClientOptions() []option.RequestOption {
38
39
if o, ok := os.LookupEnv("HYPEMAN_API_KEY"); ok {
40
defaults = append(defaults, option.WithAPIKey(o))
41
}
42
+ if o, ok := os.LookupEnv("HYPEMAN_CUSTOM_HEADERS"); ok {
43
+ for _, line := range strings.Split(o, "\n") {
44
+ colon := strings.Index(line, ":")
45
+ if colon >= 0 {
46
+ defaults = append(defaults, option.WithHeader(strings.TrimSpace(line[:colon]), strings.TrimSpace(line[colon+1:])))
47
+ }
48
49
50
return defaults
51
52
0 commit comments