fix: validate repo URL format on app creation (closes #88)

This commit is contained in:
clawbot
2026-02-19 13:44:08 -08:00
committed by user
parent 8ad2c6e42c
commit a2fb42520d
4 changed files with 140 additions and 0 deletions

View File

@@ -216,6 +216,15 @@ func (h *Handlers) HandleAPICreateApp() http.HandlerFunc {
return
}
repoURLErr := validateRepoURL(req.RepoURL)
if repoURLErr != nil {
h.respondJSON(writer, request,
map[string]string{"error": "invalid repository URL: " + repoURLErr.Error()},
http.StatusBadRequest)
return
}
createdApp, createErr := h.appService.CreateApp(request.Context(), app.CreateAppInput{
Name: req.Name,
RepoURL: req.RepoURL,