Skip to content

Commit

Permalink
Merge pull request #35 from andreykaipov/pluralize-httpheader
Browse files Browse the repository at this point in the history
rename httpheader to httpheaders
  • Loading branch information
HeavyHorst authored Nov 2, 2019
2 parents 82eedfb + 59111cc commit 85fa525
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/content/config/configuration-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ See the example configuration to see how global default values can be set for in

- **filepath(string):**
- The filepath to a yaml or json file containing the key-value pairs. This can be a local file or a remote http/https location.
- **httpheader(map[string]string):**
- **httpheaders(map[string]string):**
- Optional HTTP-headers to append to the request if the file path is a remote http/https location.
</details>

Expand Down
2 changes: 1 addition & 1 deletion integration/file/file.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ log_format = "text"
[resource.backend.file]
onetime = true
filepath = "./integration/file/config.yml"
httpheader = { X-Test-Token = "XXX", X-Test-Token2 = "YYY" }
httpheaders = { X-Test-Token = "XXX", X-Test-Token2 = "YYY" }
keys = ["/"]
4 changes: 2 additions & 2 deletions pkg/backends/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type FileConfig struct {
Filepath string

// Optional HTTP headers to append to the request if the file path is a remote http/https location.
HTTPHeader map[string]string
HTTPHeaders map[string]string
template.Backend
}

Expand All @@ -39,7 +39,7 @@ func (c *FileConfig) Connect() (template.Backend, error) {
"filepath": c.Filepath,
}).Info("set file path")

client, err := file.New(c.Filepath, file.WithHeaders(c.HTTPHeader))
client, err := file.New(c.Filepath, file.WithHeaders(c.HTTPHeaders))
if err != nil {
return c.Backend, err
}
Expand Down

0 comments on commit 85fa525

Please sign in to comment.