Fix PR review feedback

- Preserve SSRF protection by wrapping the existing transport
  instead of replacing it with a bare http.Transport
- Strip DSN from url.Parse error to avoid leaking credentials
- Gate CommonThirdPartyCombobox on search length to prevent
  showing stale results when input is shortened
- Handle multi-value and uppercase sizes attributes in
  parseSizeAttr for correct icon-size ranking
- Match rel tokens containing "icon" (e.g. "shortcut icon")
  instead of requiring an exact match
- Limit HTML response body to 10 MiB before parsing
- Reject sslmode=prefer explicitly in both import tools

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-05-12 10:12:02 +04:00
parent 6383457e6b
commit 10ac52eff3
5 changed files with 32 additions and 19 deletions

View File

@@ -50,7 +50,8 @@ func Parse(ctx context.Context, client *http.Client, websiteURL string) (*PageIn
return nil, fmt.Errorf("cannot fetch page: status %d", resp.StatusCode)
}
return ParseHTML(parsed, resp.Body)
const maxHTMLSize = 10 << 20 // 10 MiB
return ParseHTML(parsed, io.LimitReader(resp.Body, maxHTMLSize))
}
func ParseHTML(baseURL *url.URL, r io.Reader) (*PageInfo, error) {