Skip to content

Commit fbff3e8

Browse files
authored
fix: strip whitespace from CODECOV_TOKEN in Authorization header
1 parent 152ecf8 commit fbff3e8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

codecov_cli/helpers/request.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def get_token_header_or_fail(token: Optional[str]) -> dict:
109109
raise click.ClickException(
110110
"Codecov token not found. Please provide Codecov token with -t flag."
111111
)
112-
return {"Authorization": f"token {token}"}
112+
return {"Authorization": f"token {token.strip()}"}
113113

114114

115115
def get_token_header(token: Optional[str]) -> Optional[dict]:
@@ -118,7 +118,7 @@ def get_token_header(token: Optional[str]) -> Optional[dict]:
118118
"""
119119
if token is None:
120120
return None
121-
return {"Authorization": f"token {token}"}
121+
return {"Authorization": f"token {token.strip()}"}
122122

123123

124124
@retry_request

0 commit comments

Comments
 (0)