Enquote file path for shell execution.
Also, fix json of 500 response.
This commit is contained in:
@ -95,7 +95,11 @@ func (r *RunnerController) listFileSystem(writer http.ResponseWriter, request *h
|
||||
}
|
||||
|
||||
writer.Header().Set("Content-Type", "application/json")
|
||||
if err := targetRunner.ListFileSystem(path, recursive, writer, request.Context()); err != nil {
|
||||
err = targetRunner.ListFileSystem(path, recursive, writer, request.Context())
|
||||
if errors.Is(err, runner.ErrFileNotFound) {
|
||||
writeNotFound(writer, err)
|
||||
return
|
||||
} else if err != nil {
|
||||
log.WithError(err).Error("Could not perform the requested listFileSystem.")
|
||||
writeInternalServerError(writer, err, dto.ErrorUnknown)
|
||||
return
|
||||
|
Reference in New Issue
Block a user