Skip to content

Commit d40cc3c

Browse files
committed
Handle case where network in nil
1 parent 6993f6f commit d40cc3c

File tree

1 file changed

+5
-1
lines changed
  • packages/orchestrator/internal/proxy

1 file changed

+5
-1
lines changed

packages/orchestrator/internal/proxy/proxy.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,13 @@ func NewSandboxProxy(meterProvider metric.MeterProvider, port uint16, sandboxes
5151
return nil, reverseproxy.NewErrSandboxNotFound(sandboxId)
5252
}
5353

54+
var accessToken *string = nil
55+
if net := sbx.Config.Network; net != nil && net.GetIngress() != nil {
56+
accessToken = net.GetIngress().TrafficAccessToken
57+
}
58+
5459
// Handle traffic access token validation.
5560
// We are skipping envd port as it has its own access validation mechanism.
56-
accessToken := sbx.Config.Network.GetIngress().TrafficAccessToken
5761
if accessToken != nil && int64(port) != consts.DefaultEnvdServerPort {
5862
accessTokenRaw := r.Header.Get(accessTokenHeader)
5963
if accessTokenRaw == "" {

0 commit comments

Comments
 (0)