Repository navigation
Commit 713735b
committed
fix(deploy): report malformed Redis URLs instead of crashing
Codex review of #90: with REDIS_PASSWORD set, apply_redis_password() splits REDIS_URL with urlsplit() before the audit parses it. A malformed IPv6 authority such as redis://[broken makes urlsplit raise ValueError, so the guard died with a traceback instead of returning the actionable problem line the rest of the audit produces.
Resolve the Redis URL through a helper that catches the split error and reports 'REDIS_URL is not a valid connection URL.' A failed split also suppresses the follow-on 'has no password' message, since there is no URL to inspect. Add regression tests for the unsplittable authority and for a bad port, and verified by hand that the guard exits 1 with the problem line and no traceback.1 parent 59c1499 commit 713735b
2 files changed
Lines changed: 33 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
124 | 139 | | |
125 | 140 | | |
126 | 141 | | |
| |||
170 | 185 | | |
171 | 186 | | |
172 | 187 | | |
173 | | - | |
| 188 | + | |
| 189 | + | |
174 | 190 | | |
175 | 191 | | |
176 | 192 | | |
| |||
215 | 231 | | |
216 | 232 | | |
217 | 233 | | |
218 | | - | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
219 | 238 | | |
220 | 239 | | |
221 | 240 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
165 | 177 | | |
166 | 178 | | |
167 | 179 | | |
| |||
0 commit comments