w3c / Unicorn

Unicorn - W3C's Unified Validator
https://validator.w3.org/unicorn/
Other
127 stars 59 forks source link

Use GET instead of HEAD in URIInputParameter #183

Closed jeremyweber-np closed 7 years ago

jeremyweber-np commented 7 years ago

The following code block in URIInputParameter can return a different content-type depending on the http verb used. Since the eventual test will be executed using a GET it makes sense to have this code use GET instead of HEAD.

            HttpURLConnection con = (HttpURLConnection) docUrl.openConnection();
            con.setRequestProperty("User-agent", "W3C_Unicorn/1.0 (http://validator.w3.org/services)");
            con.setConnectTimeout(connectTimeOut);
            con.setRequestMethod("HEAD");
            try {
                con.connect();

A case that illustrates this, is a Unicorn General Conformance check to https://www.verizonwireless.com/smartphones/, a head request here returns application/json as the mime type which in effect cancels the test ( as that is not a valid mime type for any of the observers). Changing this GET from head, allows normal operation.

jeremyweber-np commented 7 years ago

Is anyone maintaining this project? Seems awfully quiet.

jean-gui commented 7 years ago

Note that there is still another issue with markup validation because the HTML5 validator doesn't provide a Unicorn output.