GoToSocial/internal/httpclient
Daniele Sluijters 746f3fa4e6
Additional IP range validations (#1152)
* [bugfix] Ensure requests happen over TCP

It's possible for the network to be udp4 or udp6. This is rather
unlikely to occur, but since we're given the network anyway as part of
the Sanitize function getting called we might as well check for it.

* [chore] Align reserved v6 blocks to IANA registry

* [chore] Add test for ValidateIP

The net and netip packages diverge in that net.ParseIP will consider an
IPv4-mapped address to be an IPv4 address and as such it would get
caught by the IPv4Reserved list. However, netip considers it an IPv6
address, so we need to ensure the mapped range is in IPv6Reserved.

* [chore] Align reserved v4 blocks to IANA registry

This includes a number of tests for /32's explicitly called out in the
registry to ensure we always consider those invalid.
2022-11-26 11:09:55 +00:00
..
client_test.go [security] transport.Controller{} and transport.Transport{} security and performance improvements (#564) 2022-05-15 11:16:43 +02:00
client.go Additional IP range validations (#1152) 2022-11-26 11:09:55 +00:00
request.go [performance] Don't retry/backoff invalid http requests that will never succeed (#609) 2022-05-26 13:38:41 +02:00
sanitizer.go Additional IP range validations (#1152) 2022-11-26 11:09:55 +00:00