Skip to content

Commit b8a6fe4

Browse files
committed
identify application/xml in hhtpResponses
modified: dzVents/runtime/HTTPResponse.lua
1 parent 45135c1 commit b8a6fe4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

dzVents/runtime/HTTPResponse.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ local function HTTPResponce(domoticz, responseData, testResponse)
2727
end
2828
end
2929

30-
self.isXML = false
30+
self.isXML = false
3131
self.isJSON = false
3232

3333
self.callback = responseData.callback
@@ -40,13 +40,13 @@ local function HTTPResponce(domoticz, responseData, testResponse)
4040
self.isJSON = true
4141
self.json = json
4242
end
43-
elseif (self._contentType):find('text/xml') and self.data then
44-
local xml = utils.fromXML(self.data)
43+
elseif ((self._contentType):match('application/xml') or (self._contentType):find('text/xml')) and self.data then
44+
local xml = utils.fromXML(self.data)
4545
if (xml) then
4646
self.isXML = true
4747
self.xml = xml
48-
self.xmlVersion = self.data:match([[<?xml version="(.-)"]])
49-
self.xmlEncoding = self.data:match([[encoding="(.-)"]])
48+
self.xmlVersion = self.data:match([[<?xml version="(.-)"]])
49+
self.xmlEncoding = self.data:match([[encoding="(.-)"]])
5050
end
5151
end
5252

0 commit comments

Comments
 (0)