Skip to content

fix: strip token whitespace to prevent invalid Authorization header - #767

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/strip-token-whitespace-ct5UrW
Open

fix: strip token whitespace to prevent invalid Authorization header#767
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/strip-token-whitespace-ct5UrW

Conversation

@sentry

@sentry sentry Bot commented Aug 20, 2026

Copy link
Copy Markdown

This PR addresses the ValueError: Invalid header value that occurs when the Codecov token contains trailing whitespace, such as a newline character. This typically happens when the token is read from an environment variable or file that includes such characters.

The fix involves adding .strip() to the token string before it is interpolated into the Authorization header in both get_token_header and get_token_header_or_fail functions within codecov_cli/helpers/request.py. This ensures that any leading or trailing whitespace is removed, guaranteeing a valid HTTP header format.

Fixes CLI-BS

This PR was automatically generated by Sentry. You can adjust this setting at any time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants