summaryrefslogtreecommitdiffhomepage
path: root/WebSockets.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2017-05-09 16:20:58 -0400
committerJoey Hess <joeyh@joeyh.name>2017-05-09 16:20:58 -0400
commit0bf26b8e905e2685c92e8eef4d9cdd9fcf5c49c4 (patch)
treeba6e8212dcc5d0bae87794adfc9d023986ae1315 /WebSockets.hs
parent0032fa497e738382171145578c2f3bcb445c3d2b (diff)
downloaddebug-me-0bf26b8e905e2685c92e8eef4d9cdd9fcf5c49c4.tar.gz
Avoid crash when --use-server is given an url that does not include a path.
Diffstat (limited to 'WebSockets.hs')
-rw-r--r--WebSockets.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/WebSockets.hs b/WebSockets.hs
index 359fe7b..2a0eb40 100644
--- a/WebSockets.hs
+++ b/WebSockets.hs
@@ -144,7 +144,9 @@ runClientApp serverurl app = do
port = case uriPort serverauth of
(':':s) -> fromMaybe 80 (readMaybe s)
_ -> 80
- endpoint = uriPath serverurl
+ endpoint = case uriPath serverurl of
+ [] -> "/"
+ p -> p
catchconnclosed ConnectionClosed = Just ()
catchconnclosed _ = Nothing