Skip to content

Commit c696247

Browse files
authored
Add in description of using multiple headers env variable (#681)
Added note from https://github.com/sourcegraph/src-cli/blob/main/AUTH_PROXY.md <!-- Explain the changes introduced in your PR --> ## Pull Request approval Although pull request approval is not enforced for this repository in order to reduce friction, merging without a review will generate a ticket for the docs team to review your changes. So if possible, have your pull request approved before merging.
1 parent 63ba6e7 commit c696247

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

docs/cli/explanations/env.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ SRC_HEADER_AUTHORIZATION="Bearer $(curl http://service.internal.corp)" SRC_HEADE
3333

3434
In the above example, the headers `authorization: Bearer my-generated-token` and `extra: metadata` will be threaded to all HTTP requests to your instance. Multiple such headers can be supplied.
3535

36+
An alternative to the above when passing in multiple headers or headers with dashes is to make use of the `SRC_HEADERS` environment variable as follows:
37+
38+
```sh
39+
SRC_HEADERS="AUTHORIZATION:Bearer somerandom_string\nClient-ID:client-one\nextra:metadata"
40+
```
41+
42+
Note: The different header keys and values need to separated by a new line ("\n"). In the above example, the headers `authorization: Bearer somerandom_string`, `client-id: client-one` and `extra: metadata` will be threaded to all HTTP requests to your instance.
43+
3644
Example passing env vars via a shell config file:
3745
In the .zshrc -
3846
```bash

0 commit comments

Comments
 (0)