mirror of
https://github.com/amir20/dozzle.git
synced 2026-01-04 03:54:58 +01:00
fix: supports empty values for logfmt (#3300)
This commit is contained in:
@@ -15,7 +15,6 @@ func ParseLogFmt(log string) (*orderedmap.OrderedMap[string, string], error) {
|
||||
|
||||
for i := 0; i < len(log); i++ {
|
||||
char := log[i]
|
||||
|
||||
if isKey {
|
||||
if char == '=' {
|
||||
if i == start {
|
||||
@@ -48,9 +47,6 @@ func ParseLogFmt(log string) (*orderedmap.OrderedMap[string, string], error) {
|
||||
inQuotes = true
|
||||
start = i + 1
|
||||
} else if char == ' ' {
|
||||
if i == start {
|
||||
return nil, errors.New("invalid format: value is empty")
|
||||
}
|
||||
value = log[start:i]
|
||||
result.Set(key, value)
|
||||
isKey = true
|
||||
@@ -75,9 +71,6 @@ func ParseLogFmt(log string) (*orderedmap.OrderedMap[string, string], error) {
|
||||
if inQuotes {
|
||||
return nil, errors.New("invalid format: unclosed quotes")
|
||||
}
|
||||
if start >= len(log) {
|
||||
return nil, errors.New("invalid format: value is empty")
|
||||
}
|
||||
value = log[start:]
|
||||
result.Set(key, value)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user