Fix Ls2JsonWriter
by allowing more spaces in the ls response. by sending the error response of the list file system route only when no content has been written.
This commit is contained in:
@ -15,7 +15,8 @@ import (
|
||||
var (
|
||||
log = logging.GetLogger("nullio")
|
||||
pathLineRegex = regexp.MustCompile(`(.*):$`)
|
||||
headerLineRegex = regexp.MustCompile(`([-aAbcCdDlMnpPsw?])([-rwxXsStT]{9})([+ ])\d+ (.+?) (.+?) +(\d+) (\d+) (.*)$`)
|
||||
headerLineRegex = regexp.
|
||||
MustCompile(`([-aAbcCdDlMnpPsw?])([-rwxXsStT]{9})(\+?) +\d+ +(.+?) +(.+?) +(\d+) +(\d+) +(.*)$`)
|
||||
)
|
||||
|
||||
const (
|
||||
@ -39,6 +40,10 @@ type Ls2JsonWriter struct {
|
||||
latestPath []byte
|
||||
}
|
||||
|
||||
func (w *Ls2JsonWriter) HasStartedWriting() bool {
|
||||
return w.jsonStartSent
|
||||
}
|
||||
|
||||
func (w *Ls2JsonWriter) Write(p []byte) (int, error) {
|
||||
i, err := w.initializeJSONObject()
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user