You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by zh...@apache.org on 2023/04/10 08:17:50 UTC

[apisix-ingress-controller] branch master updated: fix: malformed URL created in schemaClient (#1772)

This is an automated email from the ASF dual-hosted git repository.

zhangjintao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-ingress-controller.git


The following commit(s) were added to refs/heads/master by this push:
     new e6dbaa7a fix: malformed URL created in schemaClient (#1772)
e6dbaa7a is described below

commit e6dbaa7acb6624d9a7ebca723784380badbeb092
Author: Ashish Tiwari <as...@gmail.com>
AuthorDate: Mon Apr 10 13:47:44 2023 +0530

    fix: malformed URL created in schemaClient (#1772)
---
 pkg/apisix/schema.go      | 2 +-
 pkg/apisix/schema_test.go | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pkg/apisix/schema.go b/pkg/apisix/schema.go
index 65451137..28a7eb29 100644
--- a/pkg/apisix/schema.go
+++ b/pkg/apisix/schema.go
@@ -33,7 +33,7 @@ type schemaClient struct {
 
 func newSchemaClient(c *cluster) Schema {
 	return &schemaClient{
-		url:     c.baseURL + "/schema/",
+		url:     c.baseURL + "/schema",
 		cluster: c,
 	}
 }
diff --git a/pkg/apisix/schema_test.go b/pkg/apisix/schema_test.go
index 67fe4445..5601d09e 100644
--- a/pkg/apisix/schema_test.go
+++ b/pkg/apisix/schema_test.go
@@ -54,7 +54,7 @@ func (srv *fakeAPISIXSchemaSrv) ServeHTTP(w http.ResponseWriter, r *http.Request
 	}
 
 	if r.Method == http.MethodGet {
-		name := strings.Trim(strings.TrimPrefix(r.URL.Path, "/apisix/admin/schema/"), "/")
+		name := strings.TrimPrefix(r.URL.Path, "/apisix/admin/schema/")
 		if len(name) < 1 {
 			w.WriteHeader(http.StatusBadRequest)
 			return