datatracker
datatracker copied to clipboard
XML draft document isn't accepted by the datatracker with a complaint that the content is text/plain, despite .xml extension and form content type being text/xml
Describe the issue
Here's what's being submitted by the browser:
Content-Disposition: form-data; name="xml"; filename="draft-ietf-calext-vcard-jscontact-extensions.xml"
Content-Type: text/xml
And here's what the datatracker says:
Expected an XML file of type "application/xml" or "text/xml", found one of type "text/plain"
I'll attach the file if github allows
Code of Conduct
- [X] I agree to follow the IETF's Code of Conduct
Oh FFS Github won't let me attach a .xml file without renaming the content type. Here's the file renamed as .txt draft-ietf-calext-vcard-jscontact-extensions-xml.txt
This is libmagic doing a surprising thing. We'll dig into it and see why. But at the moment, you can work around the mystery if you change the first line of the file from
<?xml version="1.0" encoding="utf-8"?>
to
<?xml version='1.0' encoding='utf-8'?>
Right now, the datatracker checks a file with libmagic before continuing with with processing. It might be better to actually let lxml tell us it can't deal, to avoid silly issues like the above, but this will require thought to make sure we aren't opening ourselves to resource attacks as lxml tries to parse the input.