Merge pull request #19885 from whiteinge/rest_cherrypy-token-error

Also catch TokenAuthenticationError tracebacks to properly raise a 401
This commit is contained in:
Thomas S Hatch 2015-01-20 17:35:09 -07:00
commit 80f9267fca

View File

@ -345,7 +345,8 @@ def hypermedia_handler(*args, **kwargs):
try:
cherrypy.response.processors = dict(ct_out_map)
ret = cherrypy.serving.request._hypermedia_inner_handler(*args, **kwargs)
except salt.exceptions.EauthAuthenticationError:
except (salt.exceptions.EauthAuthenticationError,
salt.exceptions.TokenAuthenticationError):
raise cherrypy.HTTPError(401)
except cherrypy.CherryPyException:
raise