From e1ed6a36abffaa8a06e10ed9ab017809edbbd0d7 Mon Sep 17 00:00:00 2001 From: Felix Dietze Date: Sat, 24 Aug 2024 17:32:43 +0200 Subject: [PATCH] Fix request url for jsdomClient The `/` is already contained in `baseUri`. --- jsdomClient/src/main/scala/HttpRpcTransport.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsdomClient/src/main/scala/HttpRpcTransport.scala b/jsdomClient/src/main/scala/HttpRpcTransport.scala index bcc7601f..412063d0 100644 --- a/jsdomClient/src/main/scala/HttpRpcTransport.scala +++ b/jsdomClient/src/main/scala/HttpRpcTransport.scala @@ -19,7 +19,7 @@ object HttpRpcTransport { def apply[F[_]: Async](config: F[HttpRequestConfig]): RequestTransport[String, F] = new RequestTransport[String, F] { override def apply(request: Request[String]): F[String] = for { config <- config - url = s"${config.baseUri}/${request.method.traitName}/${request.method.methodName}" + url = s"${config.baseUri}${request.method.traitName}/${request.method.methodName}" requestArgs = new dom.RequestInit { headers = config.headers.toJSDictionary; method = dom.HttpMethod.POST; body = request.payload } result <- Async[F].fromThenable(Async[F].delay[js.Thenable[String]](dom.fetch(url, requestArgs).`then`[String](_.text()))) } yield result