f5devcentral / f5go

The F5 Go Redirector
MIT License
19 stars 8 forks source link

links with underscores in their names raise InvalidKeyword #3

Open cwbooth5 opened 9 years ago

cwbooth5 commented 9 years ago

We need to return a better error here for the user. They're not told why an underscore is wrong, nor do I really know why it's wrong. Should we allow them?

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/cherrypy/_cprequest.py", line 670, in respond
    response.body = self.handler()
  File "/usr/local/lib/python2.7/site-packages/cherrypy/lib/encoding.py", line 217, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/cherrypy/_cpdispatch.py", line 61, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "./go.py", line 757, in default
    ll = g_db.getList(keyword, create=False)
  File "/home/lab/tools/general/f5go/go.py", line 591, in getList
    raise InvalidKeyword("keyword '%s' not sanitary" % listname)
InvalidKeyword: keyword 'with_underscores' not sanitary
caphrim007 commented 9 years ago

I can't think of a technical reason to disallow them, but here's a semantic reason to

http://blog.woorank.com/2013/04/underscores-in-urls-why-are-they-not-recommended/