Skip to content

Commit a0fa7f0

Browse files
committed
fix breaking change in MediaType.toString
1 parent 869b16c commit a0fa7f0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/src/main/scala/sttp/model/MediaType.scala

+2-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ case class MediaType(
6363

6464
def isModel: Boolean = mainType.equalsIgnoreCase("model")
6565

66-
override lazy val toString: String = {
66+
private lazy val toStringCache: String = {
6767
val sb = new java.lang.StringBuilder(32) // "application/json; charset=utf-8".length == 31 ;)
6868
sb.append(mainType).append('/').append(subType)
6969
charset match {
@@ -77,6 +77,7 @@ case class MediaType(
7777
sb.toString
7878
}
7979

80+
override def toString() = toStringCache
8081
override lazy val hashCode: Int = toString.toLowerCase.hashCode
8182

8283
override def equals(that: Any): Boolean =

0 commit comments

Comments
 (0)