Skip to content

Commit

Permalink
fix: include carriage return in contents check
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronald Holshausen committed Jun 14, 2020
1 parent c9dda43 commit 7e220e8
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,9 @@ data class OptionalBody(
private fun detectStandardTextContentType(): ContentType? = when {
isPresent() -> {
val newLine = '\n'.toByte()
val cReturn = '\r'.toByte()
val s = value!!.take(32).map {
if (it == newLine) ' ' else it.toChar()
if (it == newLine || it == cReturn) ' ' else it.toChar()
}.joinToString("")
when {
s.matches(XMLREGEXP) -> ContentType.XML
Expand Down

0 comments on commit 7e220e8

Please sign in to comment.