Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Bumping version to follow semver and fixing issue with compatlists
Browse files Browse the repository at this point in the history
  • Loading branch information
molant committed Feb 24, 2015
1 parent 571629c commit a33d21e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
7 changes: 3 additions & 4 deletions app.js
Expand Up @@ -36,7 +36,8 @@ var url = require('url'),
sanitize = require('validator').sanitize,
charset = 'utf-8',
querystring = require('querystring'),
request = request.defaults({followAllRedirects: true,
version = JSON.parse(fs.readFileSync('package.json')).version,
request = request.defaults({followAllRedirects: true,
encoding: null,
jar: false,
proxy: process.env.HTTP_PROXY || process.env.http_proxy,
Expand All @@ -46,7 +47,6 @@ var url = require('url'),
'Accept-Language': 'en-US,en;q=0.5',
'User-Agent': 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)'}});


/**
* Serializes a test results array and sends it via the response
* @param {object} res The response to use to send the results
Expand All @@ -61,7 +61,7 @@ function sendResults(res, start, resultsArray) {
}
res.writeHeader(200, {"Content-Type": "application/json",
"X-Content-Type-Options": "nosniff" });
res.write(JSON.stringify({url: {uri: (this && this.url && this.url.href) || 'http://private'}, processTime: (Date.now() - start)/1000, results: results}));
res.write(JSON.stringify({version: version, url: {uri: (this && this.url && this.url.href) || 'http://private'}, processTime: (Date.now() - start)/1000, results: results}));
res.end();
}

Expand All @@ -74,7 +74,6 @@ function sendBadRequest(res){
res.end();
}


/**
* Responds with an internal server error
* */
Expand Down
9 changes: 7 additions & 2 deletions lib/checks/compatlist.js
Expand Up @@ -109,8 +109,13 @@ function addExplicitFlashApprovalSites(result) {
}
}

function addCompatSites(ieversion, result) {
var array = ieversion.indexOf('1') !== -1 ? result.iecompatlistdescription.domain : result.ie9compatlistdescription.domain;
function addCompatSites(ieversion, result) {
var array = [];
if (ieversion.indexOf('1') !== -1) {
array = result.iecompatlistdescription.domain;
} else if (result.ie9compatlistdescription) {
array = result.ie9compatlistdescription.domain;
}

for (var i = 0; i < array.length; i++) {
if (array[i]._) {
Expand Down
8 changes: 4 additions & 4 deletions package.json
@@ -1,7 +1,7 @@
{
"name": "Modern.ie",
"description": "Modern.ie will analyze a website and give hints on how to be more standards compliant",
"version": "0.5.0",
"name": "ModernIE static code scanner",
"description": "This scanner will check a website and give hints on how to be more standards compliant",
"version": "1.0.0",
"homepage": "https://github.com/InternetExplorer/modern.IE-static-code-scan",
"author": {
"name": "Microsoft"
Expand Down Expand Up @@ -49,4 +49,4 @@
"grunt-contrib-jshint": "0.7.2"
},
"keywords": []
}
}

0 comments on commit a33d21e

Please sign in to comment.