Skip to content

fix(sdk): match the URL scheme case-insensitively when redacting credentials - #6380

Merged
VascoSch92 merged 2 commits into
OpenHands:mainfrom
yftx293:fix/redact-url-scheme-case
Nov 4, 2026
Merged

VascoSch92 merged 2 commits into
OpenHands:mainfrom
yftx293:fix/redact-url-scheme-case

Conversation

@yftx293

@yftx293 yftx293 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

HUMAN:

Fixed the credential-redaction gap from #6348. I reviewed the diff and the test; an uppercase scheme must not leak a token into logs.


AGENT:

Why

redact_url_credentials matched the scheme case-sensitively (^(https?://)), while the in-text variant redact_url_credentials_in_text already compiles with IGNORECASE. A URL written HTTPS://oauth2:SECRET@host/repo.git therefore passed through unredacted, sending its credentials into logs and error messages.

Summary

Issue Number

Part of #6348 (menu sub-item: "redact_url_credentials matches the scheme case-sensitively (the _in_text variant is IGNORECASE), so ...")

How to Test

uv run pytest tests/sdk/git/test_url_redaction.py -k uppercase

Before this change the URL comes back with SECRET intact; after, it is HTTPS://****@github.com/o/r.git. tests/sdk/git/test_url_redaction.py plus tests/sdk/utils/test_redact.py is 96 passed. ruff check/format on the touched files are clean.

Type

  • Bug fix

Notes

The preserve_placeholders behaviour is unchanged: ${VAR} userinfo still passes through when requested.

@VascoSch92
VascoSch92 enabled auto-merge (squash) November 4, 2026 09:50

@VascoSch92 VascoSch92 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

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.

2 participants