Skip to content

Commit 5ed3d4e

Browse files
committed
Update remaining OriginRequestConfig functions for Http2Origins
1 parent 2345720 commit 5ed3d4e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

ingress/config.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,9 @@ func originRequestFromConfig(c config.OriginRequestConfig) OriginRequestConfig {
227227
}
228228
}
229229
}
230+
if c.Http2Origin != nil {
231+
out.Http2Origin = *c.Http2Origin
232+
}
230233
return out
231234
}
232235

@@ -377,6 +380,12 @@ func (defaults *OriginRequestConfig) setIPRules(overrides config.OriginRequestCo
377380
}
378381
}
379382

383+
func (defaults *OriginRequestConfig) setHttp2Origin(overrides config.OriginRequestConfig) {
384+
if val := overrides.Http2Origin; val != nil {
385+
defaults.Http2Origin = *val
386+
}
387+
}
388+
380389
// SetConfig gets config for the requests that cloudflared sends to origins.
381390
// Each field has a setter method which sets a value for the field by trying to find:
382391
// 1. The user config for this rule
@@ -402,6 +411,7 @@ func setConfig(defaults OriginRequestConfig, overrides config.OriginRequestConfi
402411
cfg.setProxyAddress(overrides)
403412
cfg.setProxyType(overrides)
404413
cfg.setIPRules(overrides)
414+
cfg.setHttp2Origin(overrides)
405415
return cfg
406416
}
407417

@@ -449,6 +459,7 @@ func ConvertToRawOriginConfig(c OriginRequestConfig) config.OriginRequestConfig
449459
ProxyPort: zeroUIntToNil(c.ProxyPort),
450460
ProxyType: emptyStringToNil(c.ProxyType),
451461
IPRules: convertToRawIPRules(c.IPRules),
462+
Http2Origin: defaultBoolToNil(c.Http2Origin),
452463
}
453464
}
454465

0 commit comments

Comments
 (0)