From c9c1d1b5d6eb1dbd3c0ac0323edcd0e888e6cde2 Mon Sep 17 00:00:00 2001
From: ko_oler <kooler89@gmail.com>
Date: Mon, 2 Oct 2023 12:29:29 +0300
Subject: [PATCH] =?UTF-8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=20=D0=BF?=
 =?UTF-8?q?=D0=BE=20=D0=9F=D0=A0:=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5?=
 =?UTF-8?q?=D0=BD=D0=BE=20=D1=83=D1=81=D0=BB=D0=BE=D0=B2=D0=B8=D0=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 pkg/extension/server.go            | 14 +++++++-------
 pkg/extension/service/extension.go | 14 +++++++-------
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/pkg/extension/server.go b/pkg/extension/server.go
index 9e38a22f..6f2c2442 100644
--- a/pkg/extension/server.go
+++ b/pkg/extension/server.go
@@ -81,13 +81,13 @@ func (srv *Server) Update(ctx context.Context, request *UpdateRequest) (*UpdateR
 }
 
 func (srv *Server) Action(ctx context.Context, in *pb.ActionRequest) (*pb.ActionResponse, error) {
-	ext := in.Extension
-	if ext == "" {
-		actionURL, err := action.NewURL(in.Action)
-		if err != nil {
-			return nil, err
-		}
-		ext = actionURL.Extension()
+	actionURL, err := action.NewURL(in.Action)
+	if err != nil {
+		return nil, err
+	}
+	ext := actionURL.Extension()
+	if ext == "" && in.Extension != "" {
+		ext = in.Extension
 	}
 
 	svc, ok := srv.services[ext]
diff --git a/pkg/extension/service/extension.go b/pkg/extension/service/extension.go
index 215aca85..8b9aefd3 100644
--- a/pkg/extension/service/extension.go
+++ b/pkg/extension/service/extension.go
@@ -156,13 +156,13 @@ func (s *Extension) Uninstall(ctx context.Context, in *extension.UninstallReques
 }
 
 func (s *Extension) Action(ctx context.Context, in *extension.ActionRequest) (*extension.ActionResponse, error) {
-	ext := in.Extension
-	if ext == "" {
-		actionURL, err := action.NewURL(in.Action)
-		if err != nil {
-			return nil, err
-		}
-		ext = actionURL.Extension()
+	actionURL, err := action.NewURL(in.Action)
+	if err != nil {
+		return nil, err
+	}
+	ext := actionURL.Extension()
+	if ext == "" && in.Extension != "" {
+		ext = in.Extension
 	}
 	ok, err := extension.CheckInstalled(ctx, s.Content, in.SpaceId, in.EnvId, ext)
 	if err != nil {
-- 
GitLab