diff --git a/src/main/scala/algolia/AlgoliaClient.scala b/src/main/scala/algolia/AlgoliaClient.scala index 628db4ec..0623b0fd 100644 --- a/src/main/scala/algolia/AlgoliaClient.scala +++ b/src/main/scala/algolia/AlgoliaClient.scala @@ -46,11 +46,11 @@ import scala.concurrent.{ExecutionContext, Future} class AlgoliaClient(applicationId: String, apiKey: String, customHeader: Map[String, String] = Map.empty) { if (applicationId == null || applicationId.isEmpty) { - throw new AlgoliaClientException(s"'applicationId' is probably too short: '$applicationId'") + throw AlgoliaClientException(s"'applicationId' is probably too short: '$applicationId'") } if (apiKey == null || apiKey.isEmpty) { - throw new AlgoliaClientException(s"'apiKey' is probably too short: '$apiKey'") + throw AlgoliaClientException(s"'apiKey' is probably too short: '$apiKey'") } final private val ALGOLIANET_COM_HOST = "algolianet.com" @@ -74,7 +74,7 @@ class AlgoliaClient(applicationId: String, apiKey: String, customHeader: Map[Str val httpClient: AlgoliaHttpClient = AlgoliaHttpClient() val random: AlgoliaRandom = AlgoliaRandom - val userAgent = s"Algolia for Scala ${BuildInfo.scalaVersion} API ${BuildInfo.version}" + val userAgent = s"Algolia for Scala (${BuildInfo.version}); JVM (${System.getProperty("java.version")}); Scala (${BuildInfo.scalaVersion})" val headers: Map[String, String] = customHeader ++ Map( "Accept-Encoding" -> "gzip", diff --git a/src/test/scala/algolia/AlgoliaClientTest.scala b/src/test/scala/algolia/AlgoliaClientTest.scala index cccf81c0..ac7f5d5e 100644 --- a/src/test/scala/algolia/AlgoliaClientTest.scala +++ b/src/test/scala/algolia/AlgoliaClientTest.scala @@ -50,7 +50,7 @@ class AlgoliaClientTest extends AlgoliaTest { } it("should set user agent") { - apiClient.userAgent should (startWith("Algolia for Scala 2.11") and include("API 1.")) + apiClient.userAgent should (startWith("Algolia for Scala (1.") and include("; JVM (1.8") and include ("; Scala (2.11")) } it("should set Content-Type header") {