Closed bufemc closed 3 years ago
As mentioned in previous issue, but this should go in an extra ticket, e.g. so we can solve it with a PR:
When debugging I get this for building the envelope: there is really no space between s:encodingStyle and the followed xmlns:s
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
<?xml version="1.0" encoding="utf-8"?><s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><u:GetPhonebook xmlns:u="urn:dslforum-org:service:X_AVM-DE_OnTel:1"><s:NewPhonebookId>0</s:NewPhonebookId></u:GetPhonebook></s:Body></s:Envelope>
The even more strange thing is, AVM Fritzbox does not care and will still process it, although it's TBH invalid XML!
So, what's the culprit?:
soaper.py L124:
envelope = re.sub(r'\s +', '', """ <?xml version="1.0" encoding="utf-8"?> <s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">{body} </s:Envelope> """)
the re.sub expression glues both together. If you instead write it side by side, with a space between, it will not glue, but be over the 80 columns of course .)
Seems to be not a problem with the fritz parser. However I will fix this. Thanks for reporting.
Fixed with 1.3.3
As mentioned in previous issue, but this should go in an extra ticket, e.g. so we can solve it with a PR:
When debugging I get this for building the envelope: there is really no space between s:encodingStyle and the followed xmlns:s
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
The even more strange thing is, AVM Fritzbox does not care and will still process it, although it's TBH invalid XML!
So, what's the culprit?:
soaper.py L124:
the re.sub expression glues both together. If you instead write it side by side, with a space between, it will not glue, but be over the 80 columns of course .)