mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-03 08:02:36 +09:00 
			
		
		
		
	Correction for #723
Correction for #723 Bug was : decode failed if the password contains ```:```
This commit is contained in:
		@@ -48,11 +48,11 @@ func BasicAuthDecode(encoded string) (user string, name string, err error) {
 | 
			
		||||
		return user, name, err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	a := strings.Split(string(s), ":")
 | 
			
		||||
	if len(a) == 2 {
 | 
			
		||||
		user, name = a[0], a[1]
 | 
			
		||||
	} else {
 | 
			
		||||
	a := strings.SplitN(string(s), ":", 2)
 | 
			
		||||
	if len(a) != 2 {
 | 
			
		||||
		err = errors.New("decode failed")
 | 
			
		||||
	} else {
 | 
			
		||||
		user, name = a[0], a[1]
 | 
			
		||||
	}
 | 
			
		||||
	return user, name, err
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user