Repository navigation
Commit e7ca0b0
committed
fix(api): echo only the endpoint origin in the credential-drop warning
CodeRabbit (security minor): the drop warning interpolated
ollamaBaseUrl verbatim, so URL credentials (user:pass@) or sensitive
query values in the base URL leaked to the log. The warning now
derives the WHATWG origin (protocol//host:port) via new URL() and
falls back to a fixed phrase for an unparseable host. Tests cover a
base URL carrying credentials and a query token: the warning must
contain the origin and must not contain the secret, the token value,
or the word "token"; the secure-endpoint test now also pins the
attached Authorization header. Negative control: echoing the raw
host fails exactly the drop-warning test.1 parent 6e216e2 commit e7ca0b0
2 files changed
Lines changed: 29 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2210 | 2210 | | |
2211 | 2211 | | |
2212 | 2212 | | |
2213 | | - | |
| 2213 | + | |
| 2214 | + | |
| 2215 | + | |
2214 | 2216 | | |
2215 | 2217 | | |
2216 | 2218 | | |
| |||
2221 | 2223 | | |
2222 | 2224 | | |
2223 | 2225 | | |
2224 | | - | |
| 2226 | + | |
| 2227 | + | |
| 2228 | + | |
2225 | 2229 | | |
2226 | | - | |
| 2230 | + | |
| 2231 | + | |
| 2232 | + | |
| 2233 | + | |
| 2234 | + | |
2227 | 2235 | | |
2228 | 2236 | | |
2229 | 2237 | | |
| |||
2235 | 2243 | | |
2236 | 2244 | | |
2237 | 2245 | | |
2238 | | - | |
| 2246 | + | |
| 2247 | + | |
| 2248 | + | |
2239 | 2249 | | |
2240 | 2250 | | |
2241 | 2251 | | |
2242 | 2252 | | |
2243 | 2253 | | |
| 2254 | + | |
| 2255 | + | |
2244 | 2256 | | |
2245 | 2257 | | |
2246 | 2258 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
274 | | - | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
275 | 286 | | |
276 | | - | |
| 287 | + | |
277 | 288 | | |
278 | 289 | | |
279 | 290 | | |
| |||
0 commit comments