Skip to content

Commit

Permalink
Revert "chore: add some content detection debug logs as failing on Wi…
Browse files Browse the repository at this point in the history
…ndows"

This reverts commit 9b284c3.
  • Loading branch information
Ronald Holshausen committed Jun 14, 2020
1 parent 7e220e8 commit 04236db
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ data class OptionalBody(

init {
if (contentType == ContentType.UNKNOWN) {
logger.debug { "Body content type is unknown, will try detect body contents" }
val detectedContentType = detectContentType()
logger.debug { "Detected content type = $detectedContentType" }
if (detectedContentType != null) {
this.contentType = detectedContentType
}
Expand Down Expand Up @@ -114,9 +112,7 @@ data class OptionalBody(
this.isPresent() -> {
val metadata = Metadata()
val mimetype = tika.detector.detect(TikaInputStream.get(value!!), metadata)
logger.debug { "Tika returned $mimetype" }
if (mimetype.baseType.type == "text") {
logger.debug { "Base type is text, will try match the contents" }
detectStandardTextContentType() ?: ContentType(mimetype)
} else {
ContentType(mimetype)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class OptionalBodySpec extends Specification {
OptionalBody.missing() | 'null'
OptionalBody.body(''.bytes, ContentType.UNKNOWN) | 'null'
OptionalBody.body('{}'.bytes, ContentType.UNKNOWN) | 'application/json'
bodyFromFile('/v1-pact.json') | 'application/json'
bodyFromFile('/1070-ApiConsumer-ApiProvider.json') | 'application/json'
bodyFromFile('/logback-test.xml') | 'application/xml'
bodyFromFile('/RAT.JPG') | 'image/jpeg'
}
Expand Down

0 comments on commit 04236db

Please sign in to comment.