feat(sources): add managed RSS feeds (#41)
This commit is contained in:
@ -70,7 +70,7 @@ func NewTransport(resolver Resolver, dial DialFunc) *http.Transport {
|
||||
return nil, errUnavailable
|
||||
}
|
||||
switch strings.ToLower(host) {
|
||||
case "finance.yahoo.com", "feeds.finance.yahoo.com", "www.cnbc.com":
|
||||
case "finance.yahoo.com", "feeds.finance.yahoo.com", "www.cnbc.com", "feed.quanwenrss.com":
|
||||
default:
|
||||
return nil, errUnavailable
|
||||
}
|
||||
|
||||
@ -24,7 +24,7 @@ func (f resolverFunc) LookupNetIP(c context.Context, n, h string) ([]netip.Addr,
|
||||
return f(c, n, h)
|
||||
}
|
||||
func TestForbiddenDNSAnswersNeverDial(t *testing.T) {
|
||||
for _, host := range []string{"finance.yahoo.com", "www.cnbc.com"} {
|
||||
for _, host := range []string{"finance.yahoo.com", "www.cnbc.com", "feed.quanwenrss.com"} {
|
||||
for _, value := range []string{"0.0.0.0", "10.0.0.1", "100.64.0.1", "127.0.0.1", "169.254.1.1", "172.16.0.1", "192.168.0.1", "192.0.0.9", "192.0.2.1", "198.18.0.1", "198.51.100.1", "203.0.113.1", "224.0.0.1", "240.0.0.1", "255.255.255.255", "::", "::1", "fc00::1", "fe80::1", "ff02::1", "2001:db8::1", "2002:0808:0808::1", "64:ff9b::808:808", "2001::1", "3fff::1", "::ffff:127.0.0.1"} {
|
||||
t.Run(host+"/"+value, func(t *testing.T) {
|
||||
dials := 0
|
||||
@ -67,7 +67,7 @@ func TestDNSFailsClosedAndNumericPinning(t *testing.T) {
|
||||
}
|
||||
}
|
||||
func TestPinnedTLSRetainsSNIAndHost(t *testing.T) {
|
||||
for _, host := range []string{"finance.yahoo.com", "www.cnbc.com"} {
|
||||
for _, host := range []string{"finance.yahoo.com", "www.cnbc.com", "feed.quanwenrss.com"} {
|
||||
t.Run(host, func(t *testing.T) {
|
||||
key, _ := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
|
||||
template := &x509.Certificate{SerialNumber: big.NewInt(1), DNSNames: []string{host}, NotBefore: time.Now().Add(-time.Hour), NotAfter: time.Now().Add(time.Hour), KeyUsage: x509.KeyUsageDigitalSignature, ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth}}
|
||||
@ -116,7 +116,7 @@ func TestPinnedTLSRetainsSNIAndHost(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestEveryNewConnectionRevalidatesDNS(t *testing.T) {
|
||||
for _, host := range []string{"finance.yahoo.com", "www.cnbc.com"} {
|
||||
for _, host := range []string{"finance.yahoo.com", "www.cnbc.com", "feed.quanwenrss.com"} {
|
||||
lookups, dials := 0, 0
|
||||
tr := NewTransport(resolverFunc(func(context.Context, string, string) ([]netip.Addr, error) {
|
||||
lookups++
|
||||
|
||||
Reference in New Issue
Block a user