config: allow specifying auto codec type in all-in-one mode (#2846)

* config: allow specifying auto codec type in all-in-one mode

* fix test

* fix test
This commit is contained in:
Caleb Doxsey 2021-12-22 12:34:58 -07:00 committed by GitHub
parent 0ee6a72c02
commit 6b949a5c2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 10 deletions

View file

@ -312,7 +312,6 @@ var defaultOptions = Options{
Services: "all",
CookieHTTPOnly: true,
CookieSecure: true,
CodecType: CodecTypeAuto,
CookieExpire: 14 * time.Hour,
CookieName: "_pomerium",
DefaultUpstreamTimeout: 30 * time.Second,
@ -1034,8 +1033,11 @@ func (o *Options) GetQPS() float64 {
// GetCodecType gets a codec type.
func (o *Options) GetCodecType() CodecType {
if IsAll(o.Services) && o.CodecType == CodecTypeAuto {
return CodecTypeHTTP1
if o.CodecType == CodecTypeUnset {
if IsAll(o.Services) {
return CodecTypeHTTP1
}
return CodecTypeAuto
}
return o.CodecType
}