You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0e4745a
Browse filesBrowse the repository at this point in the historyBrowse files
if(url.protocol!=="http:"&&url.protocol!=="https:")thrownewError("URL must use http:// or https://")
29
+
// Rules match the URL, so `https://[email protected]` would slip past a rule for `https://allowed.com*`.
30
+
if(url.username||url.password)thrownewError("URL must not include credentials")
31
+
}
32
+
33
+
// Follows redirects here instead of in fetch so each new URL is checked against the rules first.
34
+
// A target only fails when the rules deny it; the user is not asked again.
thrownewError("URL must start with http:// or https://")
310
354
}
355
+
// altimate_change start — upstream_fix: reject URL credentials and match rules on the requested URL (anomalyco/opencode#61701, anomalyco/opencode#60505)
356
+
letparsed: URL
311
357
try{
312
-
newURL(params.url)
358
+
parsed=newURL(params.url)
313
359
}catch{
314
360
thrownewError(`Invalid URL: "${params.url.slice(0,200)}" is not a valid URL. Check the format and try again.`)
315
361
}
362
+
assertFetchableUrl(parsed)
363
+
parsed.hash=""
364
+
consturl=parsed.href
365
+
// altimate_change end
316
366
317
367
// Check failure cache — avoid re-fetching URLs that already returned 404/410/451.
318
368
// Prefix with "(cached failure, Nm ago)" so the agent can tell a cache-hit
"URL must use http:// or https://",
0 commit comments