mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
fix: add condition for OM fuzzing
Signed-off-by: Manik Rana <manikrana54@gmail.com>
This commit is contained in:
parent
4a3e8d13ad
commit
86bd98d567
|
@ -12,7 +12,6 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
// Only build when go-fuzz is in use
|
// Only build when go-fuzz is in use
|
||||||
//go:build gofuzz
|
|
||||||
|
|
||||||
package promql
|
package promql
|
||||||
|
|
||||||
|
@ -68,6 +67,13 @@ func fuzzParseMetricWithContentType(in []byte, contentType string) int {
|
||||||
panic(warning)
|
panic(warning)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch contentType {
|
||||||
|
case "application/openmetrics-text":
|
||||||
|
p = textparse.NewOpenMetricsParserWithOpts(in, symbolTable, textparse.WithSkipCT(false))
|
||||||
|
default:
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
for {
|
for {
|
||||||
_, err = p.Next()
|
_, err = p.Next()
|
||||||
|
|
Loading…
Reference in a new issue