Skip to content

Commit 858038a

Browse files
committed
settings/proxyopts: m bounds check automode opts
1 parent 09ff1fe commit 858038a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

intra/settings/proxyopts.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ func (m AutoModeType) String() string {
141141
// SetAutoMode sets the global AutoMode variable to y.
142142
// Indicates if backend.Auto proxy is in local, remote, or hybrid mode.
143143
func SetAutoMode(m int32) (prev int32) {
144+
m = max(m, AutoModeLocal)
145+
m = min(m, AutoModeHybrid)
144146
return AutoMode.Swap(m)
145147
}
146148

0 commit comments

Comments
 (0)