TUN-4819: Tolerate protocol TXT record lookup failing
This commit is contained in:
parent
aa24338225
commit
fa8aa02270
|
@ -172,7 +172,10 @@ func NewProtocolSelector(
|
||||||
|
|
||||||
http2Percentage, err := fetchFunc()
|
http2Percentage, err := fetchFunc()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
log.Err(err).Msg("Unable to lookup protocol. Defaulting to `http2`. If this fails, you can set `--protocol h2mux` in your cloudflared command.")
|
||||||
|
return &staticProtocolSelector{
|
||||||
|
current: HTTP2,
|
||||||
|
}, nil
|
||||||
}
|
}
|
||||||
if protocolFlag == HTTP2.String() {
|
if protocolFlag == HTTP2.String() {
|
||||||
if http2Percentage < 0 {
|
if http2Percentage < 0 {
|
||||||
|
|
|
@ -158,7 +158,8 @@ func TestNewProtocolSelector(t *testing.T) {
|
||||||
protocol: "unknown",
|
protocol: "unknown",
|
||||||
fetchFunc: mockFetcherWithError(),
|
fetchFunc: mockFetcherWithError(),
|
||||||
namedTunnelConfig: testNamedTunnelConfig,
|
namedTunnelConfig: testNamedTunnelConfig,
|
||||||
wantErr: true,
|
expectedProtocol: HTTP2,
|
||||||
|
wantErr: false,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue