TUN-4819: Tolerate protocol TXT record lookup failing

This commit is contained in:
Nuno Diegues 2021-07-28 23:31:22 +01:00
parent aa24338225
commit fa8aa02270
2 changed files with 6 additions and 2 deletions

View File

@ -172,7 +172,10 @@ func NewProtocolSelector(
http2Percentage, err := fetchFunc()
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 http2Percentage < 0 {

View File

@ -158,7 +158,8 @@ func TestNewProtocolSelector(t *testing.T) {
protocol: "unknown",
fetchFunc: mockFetcherWithError(),
namedTunnelConfig: testNamedTunnelConfig,
wantErr: true,
expectedProtocol: HTTP2,
wantErr: false,
},
}