From 5ade5ee59f4351b04972bcce65f9dcd0f735d042 Mon Sep 17 00:00:00 2001 From: FrankC Date: Tue, 13 Nov 2018 15:56:06 +0100 Subject: [PATCH] Issue #12 : add extra line after HTTP headers and add quotes to the MAN header value --- SwiftSSDP/SSDPMSearchRequest.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SwiftSSDP/SSDPMSearchRequest.swift b/SwiftSSDP/SSDPMSearchRequest.swift index 5d31e3c..df08a9c 100644 --- a/SwiftSSDP/SSDPMSearchRequest.swift +++ b/SwiftSSDP/SSDPMSearchRequest.swift @@ -26,7 +26,7 @@ public struct SSDPMSearchRequest { public var message: String { var headers: SSDPHeaders = [ SSDPHeaderKeys.host: "\(SSDPDiscovery.ssdpHost):\(SSDPDiscovery.ssdpPort)", - SSDPHeaderKeys.man: self.man.rawValue, + SSDPHeaderKeys.man: "\"\(self.man.rawValue)\"", SSDPHeaderKeys.maxWait: self.maxWaitTime.description, SSDPHeaderKeys.searchTarget: self.searchTarget.description ] @@ -41,6 +41,7 @@ public struct SSDPMSearchRequest { for (key, value) in headers { message.append("\(key): \(value)\r\n") } + message.append("\r\n") return message }