NOTE: The current preferred location for bug reports is the GitHub issue tracker.
Bug 894 - Option to ignore browser-supplied MIME type for validating uploaded files
Option to ignore browser-supplied MIME type for validating uploaded files
Status: RESOLVED FIXED
Product: Validator.nu
Classification: Unclassified
Component: General
HEAD
All All
: P2 normal
Assigned To: Nobody
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-22 02:56 CET by aurimas.dev
Modified: 2015-03-31 02:59 CEST (History)
1 user (show)

See Also:


Attachments
Citation Style Language specification for American Heart Association grants (7.23 KB, text/x-csl)
2012-01-22 02:56 CET, aurimas.dev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description aurimas.dev 2012-01-22 02:56:30 CET
Created attachment 216 [details]
Citation Style Language specification for American Heart Association grants

From what I can tell, the validator uses the browser-supplied MIME type to determine if the uploaded file is an XML file (when using XML parser at least). The problem is that the browser supplies the MIME type based on the file extension (at least in Windows; tested with Chrome and Firefox), which means that XML based files that have unconventional extensions (e.g. csl extension for citation sytle language) are rejected. The "Be lax about HTTP Content-Type" option does not help in this case.

It would be nice to be able to ignore the supplied MIME type for such files. Currently, you have to either rename the file to .xml or copy-paste the contents to validate it.

Attaching a sample CSL file for testing. The contents of this file validate against the schema specified at https://github.com/citation-style-language/schema/raw/v1.0/csl.rnc using XML parser and "Be lax about HTTP Content-Type" option when copy-pasted into the validator, but not when uploaded.
Comment 1 Michael[tm] Smith 2015-03-31 02:59:44 CEST
This is fixed now https://github.com/validator/validator/issues/30