hotfix(portforwarding): allow setting ports when no custom code is running

This commit is contained in:
Quentin McGaw
2026-07-29 06:06:09 +00:00
parent df3c9fa668
commit b00279bc61
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -6,6 +6,7 @@ import (
"fmt" "fmt"
"net/http" "net/http"
"slices" "slices"
"strings"
"sync" "sync"
) )
@@ -60,7 +61,8 @@ func (s *Service) SetPortsForwarded(ctx context.Context, ports []uint16) (err er
s.portMutex.Lock() s.portMutex.Lock()
defer s.portMutex.Unlock() defer s.portMutex.Unlock()
if s.settings.PortForwarder != nil { hasPortForwardingCodeRunning := !strings.HasSuffix(s.settings.PortForwarder.Name(), "[not supported]")
if hasPortForwardingCodeRunning {
return errors.New("setting port forwarded at runtime is not supported with internally running port forwarding code") return errors.New("setting port forwarded at runtime is not supported with internally running port forwarding code")
} }
+1 -1
View File
@@ -55,7 +55,7 @@ func newNoPortForwarder(providerName string) *noPortForwarder {
} }
func (n *noPortForwarder) Name() string { func (n *noPortForwarder) Name() string {
return n.providerName return n.providerName + " [not supported]"
} }
func (n *noPortForwarder) PortForward(context.Context, pfutils.PortForwardObjects) ( func (n *noPortForwarder) PortForward(context.Context, pfutils.PortForwardObjects) (