Skip to content

Commit

Permalink
HTML; fix timeout on OSSFuzz
Browse files Browse the repository at this point in the history
  • Loading branch information
tdewolff committed Jun 17, 2023
1 parent 91fd253 commit 9e03d97
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion common.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ func Mediatype(b []byte) []byte {
} else if c == '"' {
inString = !inString
if inString {
parse.ToLower(b[lastString:i])
if i-lastString < 1024 { // ToLower may otherwise slow down minification greatly
parse.ToLower(b[lastString:i])
}
} else {
lastString = j + (i + 1 - start)
}
Expand Down

0 comments on commit 9e03d97

Please sign in to comment.