Skip to content

Commit cfcab29

Browse files
Sam SmootSam Smoot
authored andcommitted
Updated to use json4s jackson backend.
The json4s-native backend is broken in several ways. It encodes all JSON, which is allowed, but non-standard since JSON is required to be UTF-8 encoded, and it fails to properly escape UTF-8 control characters, which can often show up in localized strings. See: json4s/json4s#333 (comment) The breakage introduced in json4s 3.3.x was rolled back and corrected in PR339 as part of 3.4.0-SNAPSHOT, but that hasn't been published yet. Using the Jackson backend works around this because the breakage is limited to the native implementation.
1 parent a4fa913 commit cfcab29

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ lazy val jwt: Project = (project in file("jwt"))
6565
.settings(
6666
name := "jwt",
6767
libraryDependencies ++= Seq(
68-
"org.json4s" %% "json4s-native" % "3.3.0",
68+
"org.json4s" %% "json4s-jackson" % "3.3.0",
6969
scalaTest
7070
)
7171
) dependsOn(core)

jwt/src/main/scala/com/softwaremill/session/JwtSessionEncoder.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ package com.softwaremill.session
33
import javax.xml.bind.DatatypeConverter
44

55
import org.json4s._
6-
import org.json4s.native.JsonMethods._
7-
6+
import org.json4s.jackson.JsonMethods._
87
import scala.util.Try
98

109
class JwtSessionEncoder[T](implicit serializer: SessionSerializer[T, JValue], formats: Formats = DefaultFormats)

0 commit comments

Comments
 (0)