Skip to content

fix: parse protocol-relative Redis URLs as TCP connections - #2125

Merged
PavelPashov merged 1 commit into
redis:mainfrom
PavelPashov:fix/protocol-relative-url-parsing
Jun 4, 2026
Merged

PavelPashov merged 1 commit into
redis:mainfrom
PavelPashov:fix/protocol-relative-url-parsing

Conversation

@PavelPashov

@PavelPashov PavelPashov commented Jun 4, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #2124


Note

Low Risk
Localized URL parsing fix with tests; no auth or connection logic changes beyond correct options for // URLs.

Overview
parseURL now treats strings starting with // as protocol-relative Redis TCP URLs instead of Unix socket paths (which also start with /).

Those URLs are parsed with an implicit redis: scheme, so host, port, query options, and path-as-db behave like redis:// / rediss://. Unix socket handling is unchanged for paths that are a single leading slash (e.g. /tmp.sock). Comments note a possible future major-version break: require explicit redis:// / rediss:// instead of //.

Unit tests cover //host:port, query params, and db in the path.

Reviewed by Cursor Bugbot for commit 032a8a1. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit b6c66a9. Configure here.

Comment thread lib/utils/index.ts Resolved
@PavelPashov
PavelPashov force-pushed the fix/protocol-relative-url-parsing branch from b6c66a9 to 032a8a1 Compare June 4, 2026 09:57
@PavelPashov
PavelPashov merged commit 131ee24 into redis:main Jun 4, 2026
19 checks passed
@PavelPashov
PavelPashov deleted the fix/protocol-relative-url-parsing branch June 4, 2026 10:07
github-actions Bot pushed a commit that referenced this pull request Jun 4, 2026
## [5.11.1](v5.11.0...v5.11.1) (2026-06-04)

### Bug Fixes

* **cluster:** reconnect to nodes that restart without slot changes ([#2096](#2096)) ([c84b2ee](c84b2ee))
* parse protocol-relative Redis URLs as TCP connections ([#2125](#2125)) ([131ee24](131ee24))
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 5.11.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression in 5.11.0: parseURL treats protocol relative redis URLs as Unix socket

2 participants