Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: set content length on operator api requests #14634

Merged
merged 3 commits into from
Sep 26, 2022

Commits on Sep 22, 2022

  1. cli: set content length on operator api requests

    http.NewRequestWithContext will only set the right value for
    Content-Length if the input is *bytes.Buffer, *bytes.Reader, or
    *strings.Reader [0].
    
    Since os.Stdin is an os.File, POST requests made with the `nomad
    operator api` command would always have Content-Length set to -1, which
    is interpreted as an unknown length by web servers.
    
    [0]: https://pkg.go.dev/net/http#NewRequestWithContext
    lgfa29 committed Sep 22, 2022
    Configuration menu
    Copy the full SHA
    9ac0c0a View commit details
    Browse the repository at this point in the history
  2. changelog: add entry for #14634

    lgfa29 committed Sep 22, 2022
    Configuration menu
    Copy the full SHA
    26f06f0 View commit details
    Browse the repository at this point in the history
  3. test: don't override os.Stdin

    lgfa29 committed Sep 22, 2022
    Configuration menu
    Copy the full SHA
    1e31021 View commit details
    Browse the repository at this point in the history