Skip to content

Commit

Permalink
Merge pull request #21 from hapijs/fix-empty-segment
Browse files Browse the repository at this point in the history
Fix empty segment bug
  • Loading branch information
hueniverse committed Jul 4, 2016
2 parents 5e9e80d + 9570eee commit 8432958
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/segment.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ internals.Segment.prototype.lookup = function (path, segments, options) {

if (this._param) {
if (current ||
!this._param._edge ||
this._param._edge.segment.empty) {
(this._param._edge &&
this._param._edge.segment.empty)) {

const record = internals.deeper(this._param, nextPath, remainder, [current], options);
if (record) {
Expand Down
3 changes: 2 additions & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,8 @@ describe('Router', () => {
'/a/b/path/': {
a: 'a',
p: 'path/'
}
},
'//b/path/': false
},
'/a{b?}c': {
'/abc': {
Expand Down

0 comments on commit 8432958

Please sign in to comment.