         else
             [ "#{reqType.toUpperCase()} * HTTP/1.1" ]
 
-    for header in useHeaders
-        message.push "#{header.toUpperCase()}: #{headers[header]}"
+    for header in includeHeaders
+        message.push "#{header.toUpperCase()}: #{customHeaders[header] or defaultHeaders[header]}"
+
     # add carriage returns and new lines as required by HTTP spec
     message.push '\r\n'
     console.log message

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

                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'
