diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-05-09 16:20:58 -0400 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2017-05-09 13:42:56 -0700 |
commit | 24ac3c83db16fe6d52a326b77b1c0e4a26cb1a0a (patch) | |
tree | b388e6c7905fe7b4b750a237a1b7b5c92b6a025e /WebSockets.hs | |
parent | 6f0f452d8c5b8406aac83dd64f6c108394e63177 (diff) | |
download | debug-me-24ac3c83db16fe6d52a326b77b1c0e4a26cb1a0a.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.hs | 4 |
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 |