Ignore UTF8 BOM in JSON parser (#4099)
This commit is contained in:
committed by
Daniel Nelson
parent
c1d4b0b154
commit
9647ea88ea
@@ -428,3 +428,15 @@ func TestParseArrayWithTagKeys(t *testing.T) {
|
||||
"othertag": "baz",
|
||||
}, metrics[1].Tags())
|
||||
}
|
||||
|
||||
var jsonBOM = []byte("\xef\xbb\xbf[{\"value\":17}]")
|
||||
|
||||
func TestHttpJsonBOM(t *testing.T) {
|
||||
parser := JSONParser{
|
||||
MetricName: "json_test",
|
||||
}
|
||||
|
||||
// Most basic vanilla test
|
||||
_, err := parser.Parse(jsonBOM)
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user