fix(app): collection connects only to the addresses it checked, within 15 s, logging no address
- the fetcher resolves once, requires every address to be public and connects only to those (TLS still checks the name), so DNS rebinding cannot reach the local network; redirects too - 15 s for the whole fetch also against servers that send slowly; no URL in any log line - a site whose title alone changed is kept again - target names that differ only in case are refused (one Windows folder) - the worker always gets the collection file, so results older than the keep days go also with no targets or the feature off - the results screen lists every target with results, not only those in the newest 100 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -550,8 +550,9 @@ fn parse_collect(raw: &Map<String, Value>, d: &CollectSettings) -> Result<Collec
|
||||
if !valid_collect_name(&name) {
|
||||
return err(format!("{path}.name must be 1-32 letters, digits, - or _ (not a device name like con)"));
|
||||
}
|
||||
if targets.iter().any(|t| t.name == name) {
|
||||
return err(format!("{path}.name is listed twice"));
|
||||
// Windows folder names ignore case: `News` and `news` would share one folder and state.
|
||||
if targets.iter().any(|t| t.name.to_lowercase() == name.to_lowercase()) {
|
||||
return err(format!("{path}.name is listed twice (names that differ only in case count as the same)"));
|
||||
}
|
||||
let kind = get_str(Some(m), "kind", &path, "")?;
|
||||
let value = get_str(Some(m), "value", &path, "")?.trim().to_owned();
|
||||
@@ -867,6 +868,8 @@ mod tests {
|
||||
(t(json!({"everyMinutes": 10081})), "collect.targets[0].everyMinutes"),
|
||||
(json!({"collect": {"targets": [{"name": "a", "kind": "rss", "value": "https://a"},
|
||||
{"name": "a", "kind": "rss", "value": "https://b"}]}}), "collect.targets[1].name"),
|
||||
(json!({"collect": {"targets": [{"name": "News", "kind": "rss", "value": "https://a"},
|
||||
{"name": "news", "kind": "rss", "value": "https://b"}]}}), "collect.targets[1].name"),
|
||||
];
|
||||
for (raw, key) in cases {
|
||||
let e = parse_settings(&raw).unwrap_err();
|
||||
|
||||
Reference in New Issue
Block a user