fix empty path

This commit is contained in:
tormund 2020-06-16 21:47:07 +03:00
parent 914f997a98
commit 55d3214c57

View File

@ -207,7 +207,8 @@ proc newWebSocket*(url: string, headers: StringTableRef = nil,
var urlPath = uri.path
if uri.query.len > 0:
urlPath.add("?" & uri.query)
if urlPath.len == 0:
urlPath = "/"
let secKey = encode($genOid())[16..^1]
let requestLine = &"GET {urlPath} HTTP/1.1"
let predefinedHeaders = [