Changeset - 766696ee9487
[Not reviewed]
beta
0 1 0
Tony Bussieres - 14 years ago 2012-02-28 03:15:39
t.bussieres@gmail.com
Transplanted from: f4f564553bc4
let the is_git method exists so it is more similar to the hg backend.
1 file changed with 3 insertions and 1 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/middleware/simplegit.py
Show inline comments
 
@@ -79,22 +79,24 @@ from webob.exc import HTTPNotFound, HTTP
 

	
 
log = logging.getLogger(__name__)
 

	
 

	
 
GIT_PROTO_PAT = re.compile(r'git-upload-pack|git-receive-pack|info\/refs')
 

	
 
def is_git(action):
 
    return action in ['pull','push']
 

	
 
class SimpleGit(BaseVCSController):
 

	
 
    def _handle_request(self, environ, start_response):
 
        #======================================================================
 
        # GET ACTION PULL or PUSH
 
        #======================================================================
 
        action = self.__get_action(environ)
 

	
 
        if not action in ['pull','push']:
 
        if not is_git(action):
 
            return self.application(environ, start_response)
 

	
 
        proxy_key = 'HTTP_X_REAL_IP'
 
        def_key = 'REMOTE_ADDR'
 
        ipaddr = environ.get(proxy_key, environ.get(def_key, '0.0.0.0'))
 
        username = None
0 comments (0 inline, 0 general)