Explorar o código

Solve the problem of registering an external service reporting invalid file path

Signed-off-by: nickscut <yinxlscut@163.com>
nickscut %!s(int64=2) %!d(string=hai) anos
pai
achega
aceae2e8e7
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      internal/service/manager.go

+ 1 - 1
internal/service/manager.go

@@ -331,7 +331,7 @@ func (m *Manager) Create(r *ServiceCreationRequest) error {
 	if ok, _ := m.serviceKV.Get(name, &serviceInfo{}); ok {
 		return fmt.Errorf("service %s exist", name)
 	}
-	if !httpx.IsValidUrl(uri) || !strings.HasSuffix(uri, ".zip") {
+	if !httpx.IsValidUrl(uri) {
 		return fmt.Errorf("invalid file path %s", uri)
 	}
 	zipPath := path.Join(m.etcDir, name+".zip")