Changeset - 7cd8fd4d1e38
[Not reviewed]
beta
0 2 0
Marcin Kuzminski - 14 years ago 2011-10-24 23:07:06
marcin@python-works.com
#286 raise HttpForbidden if username lookup failed instead of internal server error
2 files changed with 4 insertions and 0 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/middleware/simplegit.py
Show inline comments
 
@@ -164,12 +164,14 @@ class SimpleGit(object):
 
                #==============================================================
 

	
 
                if action in ['pull', 'push']:
 
                    username = REMOTE_USER(environ)
 
                    try:
 
                        user = self.__get_user(username)
 
                        if user is None:
 
                            return HTTPForbidden()(environ, start_response)                        
 
                        username = user.username
 
                    except:
 
                        log.error(traceback.format_exc())
 
                        return HTTPInternalServerError()(environ,
 
                                                         start_response)
 

	
rhodecode/lib/middleware/simplehg.py
Show inline comments
 
@@ -130,12 +130,14 @@ class SimpleHg(object):
 
                #==============================================================
 

	
 
                if action in ['pull', 'push']:
 
                    username = REMOTE_USER(environ)
 
                    try:
 
                        user = self.__get_user(username)
 
                        if user is None:
 
                            return HTTPForbidden()(environ, start_response)
 
                        username = user.username
 
                    except:
 
                        log.error(traceback.format_exc())
 
                        return HTTPInternalServerError()(environ,
 
                                                         start_response)
 

	
0 comments (0 inline, 0 general)