Closed Bug 550359 Opened 14 years ago Closed 14 years ago

XML parsing error while searching in api

Categories

(addons.mozilla.org Graveyard :: API, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: krupa.mozbugs, Assigned: davedash)

References

()

Details

(Whiteboard: [z][r?jbalogh][gh:davedash])

API 1.2 URL: FAIL: https://preview.addons.mozilla.org/en-US/firefox/api/1.2/search/Gmail
shows error message as follows:
XML Parsing Error: not well-formed
Location: https://preview.addons.mozilla.org/en-US/firefox/api/1.2/search/Gmail
Line Number 107, Column 1:
 
API 1.3 URL: FAIL: https://preview.addons.mozilla.org/en-US/firefox/api/1.3/search/Gmail
shows error message as follows:
XML Parsing Error: not well-formed
Location: https://preview.addons.mozilla.org/en-US/firefox/api/1.3/search/Gmail
Line Number 107, Column 1:

Also failed while searching add-on=Outlook
https://preview.addons.mozilla.org/en-US/firefox/api/1.2/search/Outlook
https://preview.addons.mozilla.org/en-US/firefox/api/1.3/search/Outlook
error message: 
XML Parsing Error: not well-formed
Line Number 288, Column 1:
Summary: XML parsing error while searching in api → XML parsing error while searching in api(1.2/1.3/1.5)
Blocks: 549500
Thanks, I think this enough of a representative sample of this bug.  Wait until there's a fix before finding more examples.
No longer blocks: 549500
Summary: XML parsing error while searching in api(1.2/1.3/1.5) → XML parsing error while searching in api
fwiw, maybe it's a good idea not to render XML "by hand" in a template, but to have it generated from one of Python's xml writers?
Fred,

Point taken.  I'll look into using a library.
In tuxedo, I use minidom:
http://github.com/fwenzel/tuxedo/blob/master/apps/api/views.py#L250

Setting every attribute etc. like this might get tedious though with more complex files, so maybe another library is more handy in your case.
I wonder if you could spawn a new Jinja environment that will do xml-safe escaping instead of just html escaping?  I think that would keep us safe without getting bogged down in minidom.  We'd only have to check that the tags we're writing are safe, but that's not hard.
note to self... I've verified all the URLs listed to this point... most of them contain the same addon id=592 which has our "^L"
Whiteboard: [z][r?jbalogh][gh:davedash]
Took jbalogh's approach - seemed to make more sense for now, although I do see a point of having precise xml being delivered.
Status: NEW → ASSIGNED
Fixed for the issue noted in the bug, but some of the urls supplied are giving 500 errors... I suspect that's another issue.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.