This is an automated email from the ASF dual-hosted git repository.
sergeykamov pushed a commit to branch NLPCRAFT-41
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/NLPCRAFT-41 by this push:
new 2b063b8 REST server gzip Accept-Encoding support added.
2b063b8 is described below
commit 2b063b8b1a6aebdbaf78626ab27e1225b990b72c
Author: Sergey Kamov <[email protected]>
AuthorDate: Tue Aug 11 18:21:49 2020 +0300
REST server gzip Accept-Encoding support added.
---
.../main/scala/org/apache/nlpcraft/server/rest/NCBasicRestApi.scala | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/server/rest/NCBasicRestApi.scala
b/nlpcraft/src/main/scala/org/apache/nlpcraft/server/rest/NCBasicRestApi.scala
index b2425df..a4b7092 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/server/rest/NCBasicRestApi.scala
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/server/rest/NCBasicRestApi.scala
@@ -45,6 +45,8 @@ import spray.json.{JsValue, RootJsonFormat}
import scala.collection.JavaConverters._
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
+import akka.http.scaladsl.coding.NoCoding
+import akka.http.scaladsl.coding.Gzip
/**
* REST API default implementation.
@@ -1776,7 +1778,7 @@ class NCBasicRestApi extends NCRestApi with LazyLogging
with NCOpenCensusTrace w
}
} ~
post {
- withPrecompressedMediaTypeSupport {
+ encodeResponseWith(NoCoding, Gzip) {
withRequestTimeoutResponse(_ ⇒ timeoutResp) {
path(API / "signin") {
withLatency(M_SIGNIN_LATENCY_MS, signin$) } ~
path(API / "signout") {
withLatency(M_SIGNOUT_LATENCY_MS, signout$) } ~ {