docker / cli

The Docker CLI
Apache License 2.0
4.75k stars 1.88k forks source link

[26.1 backport] add support for DOCKER_CUSTOM_HEADERS env-var #5112

Open thaJeztah opened 1 month ago

thaJeztah commented 1 month ago

This environment variable allows for setting additional headers to be sent by the client. Headers set through this environment variable are added to headers set through the config-file (through the HttpHeaders field).

This environment variable can be used in situations where headers must be set for a specific invocation of the CLI, but should not be set by default, and therefore cannot be set in the config-file.

(cherry picked from commit 0d6b805256207aa5601956fa83ed94951b9f71b6)

- What I did

- How I did it

- How to verify it

- Description for the changelog

Add support for `DOCKER_CUSTOM_HEADERS` environment variable

This environment variable allows for setting additional headers to be sent by the client. Headers set through this environment variable are added to headers set through the config-file (through the HttpHeaders field).

This environment variable can be used in situations where headers must be set for a specific invocation of the CLI, but should not be set by default, and therefore cannot be set in the config-file.

- A picture of a cute animal (not mandatory but encouraged)

codecov-commenter commented 1 month ago

Codecov Report

Attention: Patch coverage is 66.66667% with 8 lines in your changes missing coverage. Please review.

Project coverage is 61.36%. Comparing base (5dab297) to head (bc2aeee).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## 26.1 #5112 +/- ## ========================================== + Coverage 61.35% 61.36% +0.01% ========================================== Files 298 298 Lines 20712 20735 +23 ========================================== + Hits 12707 12724 +17 - Misses 7103 7106 +3 - Partials 902 905 +3 ```