mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-04 09:44:21 +00:00 
			
		
		
		
	
				
					committed by
					
						
						Kim "BKC" Carlbäcker
					
				
			
			
				
	
			
			
			
						parent
						
							d0490c187c
						
					
				
				
					commit
					6510e57758
				
			@@ -20,16 +20,16 @@ func assertLineEqual(t *testing.T, d1 *DiffLine, d2 *DiffLine) {
 | 
			
		||||
 | 
			
		||||
func TestDiffToHTML(t *testing.T) {
 | 
			
		||||
	assertEqual(t, "+foo <span class=\"added-code\">bar</span> biz", diffToHTML([]dmp.Diff{
 | 
			
		||||
		dmp.Diff{dmp.DiffEqual, "foo "},
 | 
			
		||||
		dmp.Diff{dmp.DiffInsert, "bar"},
 | 
			
		||||
		dmp.Diff{dmp.DiffDelete, " baz"},
 | 
			
		||||
		dmp.Diff{dmp.DiffEqual, " biz"},
 | 
			
		||||
		{dmp.DiffEqual, "foo "},
 | 
			
		||||
		{dmp.DiffInsert, "bar"},
 | 
			
		||||
		{dmp.DiffDelete, " baz"},
 | 
			
		||||
		{dmp.DiffEqual, " biz"},
 | 
			
		||||
	}, DiffLineAdd))
 | 
			
		||||
 | 
			
		||||
	assertEqual(t, "-foo <span class=\"removed-code\">bar</span> biz", diffToHTML([]dmp.Diff{
 | 
			
		||||
		dmp.Diff{dmp.DiffEqual, "foo "},
 | 
			
		||||
		dmp.Diff{dmp.DiffDelete, "bar"},
 | 
			
		||||
		dmp.Diff{dmp.DiffInsert, " baz"},
 | 
			
		||||
		dmp.Diff{dmp.DiffEqual, " biz"},
 | 
			
		||||
		{dmp.DiffEqual, "foo "},
 | 
			
		||||
		{dmp.DiffDelete, "bar"},
 | 
			
		||||
		{dmp.DiffInsert, " baz"},
 | 
			
		||||
		{dmp.DiffEqual, " biz"},
 | 
			
		||||
	}, DiffLineDel))
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -90,5 +90,5 @@ func transformKey(key string) string {
 | 
			
		||||
		return key
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return filepath.Join(key[0:2], key[2:4], key[4:len(key)])
 | 
			
		||||
	return filepath.Join(key[0:2], key[2:4], key[4:])
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -220,7 +220,7 @@ func (s *sendmailSender) Send(from string, to []string, msg io.WriterTo) error {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	_,err = msg.WriteTo(pipe)
 | 
			
		||||
	_, err = msg.WriteTo(pipe)
 | 
			
		||||
 | 
			
		||||
	// we MUST close the pipe or sendmail will hang waiting for more of the message
 | 
			
		||||
	// Also we should wait on our sendmail command even if something fails
 | 
			
		||||
@@ -263,7 +263,6 @@ func NewContext() {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	if setting.MailService.UseSendmail {
 | 
			
		||||
		Sender = &sendmailSender{}
 | 
			
		||||
	} else {
 | 
			
		||||
 
 | 
			
		||||
@@ -94,7 +94,7 @@ func HTTP(ctx *context.Context) {
 | 
			
		||||
				ctx.HandleText(401, "reverse proxy login error, got error while running GetUserByName")
 | 
			
		||||
				return
 | 
			
		||||
			}
 | 
			
		||||
		}else{
 | 
			
		||||
		} else {
 | 
			
		||||
			authHead := ctx.Req.Header.Get("Authorization")
 | 
			
		||||
			if len(authHead) == 0 {
 | 
			
		||||
				ctx.Resp.Header().Set("WWW-Authenticate", "Basic realm=\".\"")
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user