Skip to content

Commit 0a2e985

Browse files
author
柳丰
committed
fix: only dapr appPort can be accessed in proxy mode
Signed-off-by: imneov <[email protected]>
1 parent 2c3a2cd commit 0a2e985

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pkg/kubernetes/invoke.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ package kubernetes
1616
import (
1717
"context"
1818
"fmt"
19-
"github.com/dapr/cli/pkg/api"
2019
"net/url"
2120
"strings"
2221

@@ -160,7 +159,7 @@ func (a *AppInfo) Request(r *rest.Request, method string, data []byte, verb stri
160159
Resource("pods").
161160
SubResource("proxy").
162161
SetHeader("Content-Type", "application/json").
163-
Name(net.JoinSchemeNamePort("", a.PodName, a.HTTPPort))
162+
Name(net.JoinSchemeNamePort("", a.PodName, a.AppPort))
164163
if data != nil {
165164
r = r.Body(data)
166165
}
@@ -170,7 +169,7 @@ func (a *AppInfo) Request(r *rest.Request, method string, data []byte, verb stri
170169
return nil, fmt.Errorf("error parse method %s: %w", method, err)
171170
}
172171

173-
suffix := fmt.Sprintf("v%s/invoke/%s/method/%s", api.RuntimeAPIVersion, a.AppID, u.Path)
172+
suffix := fmt.Sprintf("%s", u.Path)
174173
r = r.Suffix(suffix)
175174

176175
for k, vs := range u.Query() {

0 commit comments

Comments
 (0)