소스 검색

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