mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-15 08:16:38 +00:00
fix: refuse a Redis URL on port zero
parts.port returns 0 rather than raising, since 0 is inside the range it checks, so the URL reached .env and the worker and cache had nothing to connect to.
This commit is contained in:
1 parent
51b2fa38de
commit
06f233925b
2 files changed
+9
-2
No files matched your search
@@ -231,7 +231,8 @@ class TestNativeUp:
|
||||
with pytest.raises(DeployError, match="too long to read"):
|
||||
_run(argv, _native_context())
|
||||
|
||||
@pytest.mark.parametrize("url", ["redis://localhost:notaport/0", "redis://localhost:65536/0"])
|
||||
@pytest.mark.parametrize("url", ["redis://localhost:notaport/0", "redis://localhost:65536/0",
|
||||
"redis://localhost:0/0"])
|
||||
def test_a_redis_url_with_an_unusable_port_is_refused(self, tmp_path, url):
|
||||
"""urlsplit accepts it and rebuilds it verbatim; only .port notices, and the worker dies later."""
|
||||
argv = ["up", "--native", "--dir", str(tmp_path), "--yes",
|
||||
|
||||
Reference in new issue
Block a user