Enquote file path for shell execution.

Also, fix json of 500 response.
This commit is contained in:
Maximilian Paß
2022-08-21 12:35:13 +02:00
parent 152b77afe5
commit fc77f11d4d
4 changed files with 16 additions and 6 deletions

View File

@ -76,9 +76,11 @@ func (w *Ls2JsonWriter) initializeJSONObject() (count int, err error) {
}
func (w *Ls2JsonWriter) Close() {
count, err := w.Target.Write([]byte("]}"))
if count == 0 || err != nil {
log.WithError(err).Warn("Could not Close ls2json writer")
if w.jsonStartSend {
count, err := w.Target.Write([]byte("]}"))
if count == 0 || err != nil {
log.WithError(err).Warn("Could not Close ls2json writer")
}
}
}