Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix TypeError if path /constructor/foo is accessed #16

Merged
merged 3 commits into from May 19, 2016
Merged

fix TypeError if path /constructor/foo is accessed #16

merged 3 commits into from May 19, 2016

Commits on Jan 14, 2016

  1. fix TypeError if path /constructor/foo is accessed

    If there are any literals available in the router, then any access to a path with
    multiple segments and its first segment an object prototype property lead to a
    TypeError.
    
    This fixes these TypeErrors by checking whether the property is the literal list's own.
    
    There is a similar code path for the `this._fulls` but the path always contains a leading slash,
    thus is not vulnerable to such error.
    
    ```
    Debug: internal, implementation, error
        TypeError: match.lookup is not a function
        at Object.internals.deeper (/some-project/node_modules/hapi/node_modules/call/lib/segment.js:240:28)
        at internals.Segment.lookup (/some-project/node_modules/hapi/node_modules/call/lib/segment.js:177:36)
        at internals.Router._lookup (/some-project/node_modules/hapi/node_modules/call/lib/index.js:113:28)
        at internals.Router.route (/some-project/node_modules/hapi/node_modules/call/lib/index.js:94:22)
        at internals.Request._lifecycle (/some-project/node_modules/hapi/lib/request.js:343:41)
        at internals.Request._execute (/some-project/node_modules/hapi/lib/request.js:312:21)
        at Domain.<anonymous> (/some-project/node_modules/hapi/lib/connection.js:253:25)
        at Domain.run (domain.js:191:14)
        at internals.Protect.enter (/some-project/node_modules/hapi/lib/protect.js:84:17)
        at Server.internals.Connection._dispatch (/some-project/node_modules/hapi/lib/connection.js:251:30)
    ```
    rndstr committed Jan 14, 2016
    Copy the full SHA
    901590c View commit details
    Browse the repository at this point in the history
  2. es6. See #17

    rndstr committed Jan 14, 2016
    Copy the full SHA
    d7753ec View commit details
    Browse the repository at this point in the history

Commits on Jan 15, 2016

  1. fix linting issues

    rndstr committed Jan 15, 2016
    Copy the full SHA
    c4792f9 View commit details
    Browse the repository at this point in the history