'use strict';

var $http = require('request'),
    $q = require('q');

module.exports = function (req, res) {
    if (req.query && req.query.url) {

        $http.get({
                url: req.query.url,
                headers: {
                    'User-Agent': 'googlebot'
                }
            },
            function (err, response, html) {
                if (!err && +response.statusCode === +200) {

                    res.json({
                        html: html
                    });

                } else {
                    res.status(404).send('error status');
                }
            }).on('error', function (err) {
                res.status(404).send('error request');
            });
    } else {
        res.status(404).send('no url');
    }
};
@@ -567,27 +567,149 @@
 04).
-send('error status'
+json(%7B%0A                        err: err,%0A                        response: response,%0A                        html: html%0A                    %7D
 );%0A 
@@ -887,10 +887,13 @@
 nd('
-no
+error
  url

fix decoding