Переглянути джерело

feat: support enabled endpoint

Yeuoly 10 місяців тому
батько
коміт
2e2dbe7797
1 змінених файлів з 5 додано та 0 видалено
  1. 5 0
      internal/service/endpoint.go

+ 5 - 0
internal/service/endpoint.go

@@ -29,6 +29,11 @@ func Endpoint(
 	plugin_installation *models.PluginInstallation,
 	path string,
 ) {
+	if !endpoint.Enabled {
+		ctx.JSON(404, gin.H{"error": "plugin not found"})
+		return
+	}
+
 	req := ctx.Request.Clone(context.Background())
 	req.URL.Path = path