Skip to content

Commit

Permalink
Closes hapijs#804
Browse files Browse the repository at this point in the history
  • Loading branch information
Eran Hammer committed May 1, 2013
1 parent 5e85518 commit caa5f56
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
1 change: 0 additions & 1 deletion lib/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ exports.fileHandler = function (route, options) {
var filePath = (typeof options === 'object') ? options.path : options;
var mode = (typeof options === 'object') ? options.mode : false;
Utils.assert(filePath && (typeof filePath === 'function' || typeof filePath === 'string'), 'Invalid file path');
Utils.assert(typeof filePath !== 'string' || route.params.length === 0, 'Route path with static file path cannot contain a parameter');
Utils.assert(typeof filePath !== 'string' || filePath[filePath.length - 1] !== '/', 'File path cannot end with a \'/\'');

var absolutePath = internals.absolutePath(route);
Expand Down
12 changes: 0 additions & 12 deletions test/integration/response.js
Original file line number Diff line number Diff line change
Expand Up @@ -728,18 +728,6 @@ describe('Response', function () {
});
});

it('throws an error when adding a route with a parameter and string path', function (done) {

var fn = function () {

var server = new Hapi.Server(0, { files: { relativeTo: 'routes' } });
server.route({ method: 'GET', path: '/fileparam/{path}', handler: { file: './package.json' } });
};

expect(fn).to.throw(Error);
done();
});

it('doesn\'t throw an error when adding a route with a parameter and function path', function (done) {

var fn = function () {
Expand Down

0 comments on commit caa5f56

Please sign in to comment.