Skip to content

Commit

Permalink
simplified and improved MIME parsing
Browse files Browse the repository at this point in the history
the previous version didn't handle cases without a space
character after the semicolon
  • Loading branch information
dnet committed Jul 9, 2020
1 parent 217a4dc commit becd328
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/kotlin/burp/BurpExtender.kt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ data class MessageInfo(val content: ByteArray, val text: String, val headers: Li
}
}
headers?.filter { it.startsWith("content-type: ", ignoreCase = true) }?.forEach {
val parts = it.split(' ')[1].trim(';').split('/')
val parts = it.split(' ', ';')[1].split('/')
val ext = mimeTypes[parts[0]]?.get(parts[1]) ?: return@forEach
return ".$ext"
}
Expand Down

0 comments on commit becd328

Please sign in to comment.