iron-meteor / iron-router

A client and server side router designed specifically for Meteor.
MIT License
1.98k stars 412 forks source link

Tripple slash `///` causing exception #1462

Open dr-dimitru opened 8 years ago

dr-dimitru commented 8 years ago

I've found strange exception when in URL is three slashes used (found my mistake :). This issue doesn't appear with two or more than three slashes. Example - in console:

Exception in callback of async function: TypeError: Cannot read property 'getName' of undefined
    at h.lookupTemplate (https://iron-router-progress.meteor.com/5c03e3f161439fa021977292d82c530592f205ad.js:87:5319)
    at h.render (https://iron-router-progress.meteor.com/5c03e3f161439fa021977292d82c530592f205ad.js:87:5585)
    at h.action (https://iron-router-progress.meteor.com/5c03e3f161439fa021977292d82c530592f205ad.js:87:5183)
    at o (https://iron-router-progress.meteor.com/5c03e3f161439fa021977292d82c530592f205ad.js:62:867)
    at p (https://iron-router-progress.meteor.com/5c03e3f161439fa021977292d82c530592f205ad.js:62:3912)
    at null.next (https://iron-router-progress.meteor.com/5c03e3f161439fa021977292d82c530592f205ad.js:3:6647)
    at null.<anonymous> (https://iron-router-progress.meteor.com/5c03e3f161439fa021977292d82c530592f205ad.js:89:3243)
    at https://iron-router-progress.meteor.com/5c03e3f161439fa021977292d82c530592f205ad.js:87:11379
    at t.extend.withValue (https://iron-router-progress.meteor.com/5c03e3f161439fa021977292d82c530592f205ad.js:3:6389)
    at u (https://iron-router-progress.meteor.com/5c03e3f161439fa021977292d82c530592f205ad.js:87:11333)
jsamr commented 8 years ago

You will notice on the official url specifications that a path, i.e. the section of the url after the authoritative portion (iron-router-progress.meteor.com/[path]), has to start with a non-empty segment, namely segment-nz = 1*pchar. So your path was not compliant with those specifications. Perhaps the router shall explicitly states when the route is not url compliant?

dr-dimitru commented 8 years ago

google 4-time slash google triple slash google double slash

As you see Google works in favour of best user experience, and we all should too.

jsamr commented 8 years ago

Ahah good point! Well I'm not involved in the project, it's their call. But this should be configurable and specified in the router, with some "useStrictUrls" option.