Skip to content

Commit

Permalink
fix(server): Add validation for empty URL list in citygml packer (#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
orisano authored Oct 11, 2024
1 parent f7e2328 commit d0af10b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion server/citygml/packer.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ func (p *packer) handlePackRequest(c echo.Context) error {
"error": err.Error(),
})
}
if len(req.URLs) == 0 {
return c.JSON(http.StatusBadRequest, map[string]any{
"reason": "no urls provided",
})
}
for _, citygmlURL := range req.URLs {
u, err := url.Parse(citygmlURL)
if err != nil {
Expand Down Expand Up @@ -144,7 +149,7 @@ func (p *packer) packAsync(ctx context.Context, req PackAsyncRequest) error {
p.conf.CityGMLPackerImage,
},
Steps: []*cloudbuild.BuildStep{
{Args: append([]string{"citygml-packer", "-dest", req.Dest, "-domain", req.Domain}, req.URLs...)},
{Name: "citygml-pack", Args: append([]string{"citygml-packer", "-dest", req.Dest, "-domain", req.Domain}, req.URLs...)},
},
}
var err error
Expand Down

0 comments on commit d0af10b

Please sign in to comment.