mrlannigan / node-akamai

Communication with Akamai's CCUAPI
MIT License
14 stars 8 forks source link

Getting Java XML error when passing a url with a querystring #4

Closed nirzicherman closed 10 years ago

nirzicherman commented 11 years ago

I am passing urls to the purge function using the same example listed in the README under "Example Usage". The error I get back from Akamai is:

Exception: class org.xml.sax.SAXParseException: The reference to entity "country" must end with the ';' delimiter`

This appears to be a Java error arising from parsing xml. All of my urls have querystrings. None of my urls contain semicolons.

nirzicherman commented 11 years ago

The source of the issue is that ampersands are special characters in xml, and Akamai uses an xml-based SOAP request. Ampersands need to be encoded as & if they aren't already. Should this be built into the module?

url = url.replace(/&(?!amp;)/g, '&')
mrlannigan commented 11 years ago

@nirzicherman Can you send an example of a url that you are trying to purge?

mrlannigan commented 10 years ago

Won't fix. Akamai is shutting down their SOAP api and replacing with a new RESTful api.