Browse Source

fix: https://github.com/langgenius/dify-plugin-sdks/issues/12

Yeuoly 9 months ago
parent
commit
ecb0664059
1 changed files with 6 additions and 0 deletions
  1. 6 0
      internal/service/endpoint.go

+ 6 - 0
internal/service/endpoint.go

@@ -39,7 +39,13 @@ func Endpoint(
 	}
 
 	req := ctx.Request.Clone(context.Background())
+	// get query params
+	queryParams := req.URL.Query()
+
+	// replace path with endpoint path
 	req.URL.Path = path
+	// set query params
+	req.URL.RawQuery = queryParams.Encode()
 
 	// read request body until complete, max 10MB
 	body, err := io.ReadAll(io.LimitReader(req.Body, 10*1024*1024))