Skip to content

Commit

Permalink
airframe-http: Handle when port number is empty string (#1060)
Browse files Browse the repository at this point in the history
  • Loading branch information
xerial committed May 8, 2020
1 parent d018032 commit 6015849
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -47,8 +47,8 @@ object JSHttpClient {
// Use local client for testing
localClient
} else {
val port = window.location.port.toInt
val address = ServerAddress(hostname, port, protocol)
val port = Option(window.location.port).map(x => if (x.isEmpty) "" else s":${x}").getOrElse("")
val address = ServerAddress(s"${protocol}://${hostname}${port}")
JSHttpClient(JSHttpClientConfig(serverAddress = Some(address)))
}
}
Expand Down

0 comments on commit 6015849

Please sign in to comment.