var p = require('path'),
    fs = require('fs'),
    CONFIG = require('config');

function FileController(mongoose){

    var addExtension = function(name, ext){
        return name + '.' + ext;
    };

    var serve = function(req, res, ext){

        var addExtension = function(name){
            return name + '.' + ext;
        };

        var owner = req.params.owner;
        var repo = req.params.repo;
        var name = req.params.name;
        var file = addExtension(name);
        var filePath = p.join(CONFIG.storage, owner, repo, file);
        fs.exists(filePath, function(exists) {
            if (exists) res.status(200).sendfile(filePath);
            else res.status(404).json({message: "The Requested File Does Not Exist"})
        });
    };

    this.getPdf = function(req, res){
        serve(req, res, 'pdf');
    };

    this.getPdf = function(req, res){
        serve(req, res, 'log');
    };}

module.exports = FileController;
@@ -115,93 +115,8 @@
 )%7B%0A%0A
-    var addExtension = function(name, ext)%7B%0A        return name + '.' + ext;%0A    %7D;%0A%0A
     
@@ -452,16 +452,22 @@
 r, repo,
+ name,
  file);%0A

Fix FileController