ipn/serve: validate service paths in HasPathHandler
Fixes #17839 Signed-off-by: Sachin Iyer <siyer@detail.dev>
This commit is contained in:
committed by
Adrian Dewhurst
parent
c54d243690
commit
53476ce872
@@ -238,6 +238,20 @@ func (sc *ServeConfig) HasPathHandler() bool {
|
||||
}
|
||||
}
|
||||
|
||||
if sc.Services != nil {
|
||||
for _, serviceConfig := range sc.Services {
|
||||
if serviceConfig.Web != nil {
|
||||
for _, webServerConfig := range serviceConfig.Web {
|
||||
for _, httpHandler := range webServerConfig.Handlers {
|
||||
if httpHandler.Path != "" {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if sc.Foreground != nil {
|
||||
for _, fgConfig := range sc.Foreground {
|
||||
if fgConfig.HasPathHandler() {
|
||||
|
||||
Reference in New Issue
Block a user