mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 21:28:11 +09:00 
			
		
		
		
	Use strings.Cut for GIT_PROTOCOL value (#20638)
				
					
				
			- As per https://github.com/go-gitea/gitea/pull/20616#discussion_r935612542
This commit is contained in:
		| @@ -78,8 +78,7 @@ func sessionHandler(session ssh.Session) { | ||||
| 	gitProtocol := "" | ||||
| 	for _, env := range session.Environ() { | ||||
| 		if strings.HasPrefix(env, "GIT_PROTOCOL=") { | ||||
| 			// The value would be version=2, so using normal split doesn't work here. | ||||
| 			gitProtocol = strings.SplitN(env, "=", 2)[1] | ||||
| 			_, gitProtocol, _ = strings.Cut(env, "=") | ||||
| 			break | ||||
| 		} | ||||
| 	} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user