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

Typos in redirect config are fatal / bad messaging #59

Open
pushred opened this issue Aug 27, 2013 · 1 comment
Open

Typos in redirect config are fatal / bad messaging #59

pushred opened this issue Aug 27, 2013 · 1 comment

Comments

@pushred
Copy link
Member

pushred commented Aug 27, 2013

A bad key in the redirect JSON config causes the server to fail in certain environments. Dev seemed to work but deploying to modulus didn't work. Thankfully in the latter I was given better feedback in the log about what was wrong.

https://github.com/SparkartGroupInc/keithurban.net/commit/1ee1fe0ebda4a8d83384b962b973fcc7537d3762

Fatal error: Cannot call method 'charAt' of undefined

vs.

path.js:336
    var isAbsolute = path.charAt(0) === '/',
                          ^
TypeError: Cannot call method 'charAt' of undefined
    at Object.exports.normalize (path.js:336:27)
    at new Redirect (/mnt/data/1/node_modules/solidus/lib/redirect.js:21:33)
    at /mnt/data/1/node_modules/solidus/lib/server.js:142:20
    at fs.js:266:14
    at Object.oncomplete (fs.js:107:15)
@Fauntleroy
Copy link
Contributor

I'm not sure exactly what you want me to do about this. Do you want to check all the keys in the redirect JSON and see if they're on the whitelist? I suppose we could put pre-emptive error checking like that into Solidus, but we'd end up having lots of code in place to respond to weird user input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants