Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2ee58665ff |
@@ -164,17 +164,6 @@ func addDShieldNetwork(builder *netipx.IPSetBuilder, line string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// onionooDetails is the part of an Onionoo details document that holds the
|
|
||||||
// relays' addresses.
|
|
||||||
//
|
|
||||||
//nolint:tagliatelle // Onionoo's own field names
|
|
||||||
type onionooDetails struct {
|
|
||||||
Relays []struct {
|
|
||||||
ExitAddresses []string `json:"exit_addresses"`
|
|
||||||
ORAddresses []string `json:"or_addresses"`
|
|
||||||
} `json:"relays"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// parseOnionoo returns every address in the exit_addresses and or_addresses
|
// parseOnionoo returns every address in the exit_addresses and or_addresses
|
||||||
// fields of the relays in an Onionoo details document. A document with no
|
// fields of the relays in an Onionoo details document. A document with no
|
||||||
// addresses fails, because the Tor network always has relays.
|
// addresses fails, because the Tor network always has relays.
|
||||||
@@ -184,7 +173,13 @@ func parseOnionoo(r io.Reader) (*netipx.IPSet, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
var details onionooDetails
|
//nolint:tagliatelle // Onionoo's own field names
|
||||||
|
var details struct {
|
||||||
|
Relays []struct {
|
||||||
|
ExitAddresses []string `json:"exit_addresses"`
|
||||||
|
ORAddresses []string `json:"or_addresses"`
|
||||||
|
} `json:"relays"`
|
||||||
|
}
|
||||||
|
|
||||||
err = json.Unmarshal(data, &details)
|
err = json.Unmarshal(data, &details)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in new issue
Block a user