mirror of
https://github.com/xroche/httrack.git
synced 2026-07-23 01:01:41 +03:00
* Strip only the scheme's own default port, not :80 on every scheme hts_strip_default_port treated 80 as the default for every scheme, so an explicit :80 on a non-http URL was dropped and the fetch silently moved to that scheme's real default: https://h:80/x became https://h/x (fetched on 443), ftp likewise. The reverse gap: a scheme's own default (443 https, 21 ftp) was never stripped, so https://h:443/x kept a redundant port and would not dedup against the portless form. Derive the default from lien's scheme (80 http, 443 https, 21 ftp; 80 when absent or unknown) and strip only when the port equals that. Same family as #627/#614. Closes #638 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Xavier Roche <roche@httrack.com> * Exclude the auth-bypass CodeQL query and pin case-insensitive scheme matching cpp/user-controlled-bypass models auth-bypass-by-spoofing, but httrack has no auth or access-control surface; its nearest downstream decision, the +/- crawl filter, is a mirror boundary, not a security one. Exclude it like the world-writable query. The stripport self-test's scheme detection is case-insensitive (strfield/streql) but nothing pinned it: a case-sensitive rewrite would strip :80 from HTTPS:// unnoticed. Replace the non-discriminating :8443 case (no scheme defaults to 8443, so it passes for any impl) with HTTPS://h:80, which must keep its port. Note at scheme_default_port that schemeless/protocol-relative links default to 80. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Xavier Roche <roche@httrack.com> * Tighten the #638 comments Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Xavier Roche <roche@httrack.com> --------- Signed-off-by: Xavier Roche <roche@httrack.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>