     sendMessages(
         makeMessage(
             'ok'
-            [ 'cache-control', 'ext', 'location', 'server', 'st', 'usn' ]
-            st: st
+            st: st, ext: null
             dev, httpServer
         ) for st in (if req.searchType is 'ssdp:all' then makeNotificationHeaders(dev) else [ req.searchType ])
         req.address

    sendMessages(
        makeMessage(
            'notify'
            [ 'host', 'cache-control', 'location', 'nt', 'nts', 'server', 'usn' ]
            nt: nt, nts: 'ssdp:alive'
            dev, httpServer
        ) for nt in makeNotificationHeaders(dev)
    )

                socket.close()

# generate SSDP (HTTPU/HTTPMU) headers suiting the message type
makeMessage = (reqType, customHeaders, dev, httpServer) ->
    # headers with static values
    defaultHeaders =
        host: "#{config.ssdp.address}:#{config.ssdp.port}"
        'cache-control': "max-age = #{config.ssdp.timeout}"
        location: makeDescriptionUrl httpServer
        server: makeServerString dev
        ext: ''
        usn: config.uuid + (if config.uuid in [ customHeaders.nt, customHeaders.st ] then '' else '::' + customHeaders.nt or customHeaders.st)

    # headers that are always used
    includeHeaders = [ 'cache-control', 'server', 'usn', 'location' ]
    # add passed headers to list of headers to include
    for key of customHeaders
        includeHeaders.push key

    # build message string
    message =
        if reqType is 'ok'
