Skip to content

Commit

Permalink
Make sure to convert string to url
Browse files Browse the repository at this point in the history
Fixes #35
  • Loading branch information
britzl committed Jul 30, 2023
1 parent 39d66a5 commit 342b4bf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion in/cursor.lua
Expand Up @@ -22,7 +22,11 @@ local listeners = {}
local EMPTY = hash("")

local function url_to_key(url)
url = url or msg.url()
if type(url) == "string" then
url = msg.url(url)
else
url = url or msg.url()
end
return hash_to_hex(url.socket or EMPTY) .. hash_to_hex(url.path or EMPTY) ..hash_to_hex(url.fragment or EMPTY)
end

Expand Down

0 comments on commit 342b4bf

Please sign in to comment.