Skip to content

Commit

Permalink
update SSDP to respond to generic URN
Browse files Browse the repository at this point in the history
  • Loading branch information
heythisisnate committed Mar 22, 2023
1 parent 1d1cd9f commit c74c3f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lfs/ssdp_response.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ local function ssdpResponse(c, d, port, ip)
local device = require("device")
local info = node.info("sw_version")
local urn = d:match("ST: (urn:[%w%p]*)")
if (urn == device.urn or string.match(d, "ST: ssdp:all")) then
if (string.match(d, "ST:%s*ssdp:all") or (urn and device.urn:sub(1, #urn) == urn)) then
print("Heap: ", node.heap(), "Responding to UPnP Discovery request from " .. ip .. ":" .. port)
local resp =
"HTTP/1.1 200 OK\r\n" ..
Expand Down

0 comments on commit c74c3f4

Please sign in to comment.