mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	The admin config page has been broken for many many times, a little refactoring would make this page panic. So, add a test for it, and add another test to cover the 500 error page. Co-authored-by: Giteabot <teabot@gitea.io>
		
			
				
	
	
		
			19 lines
		
	
	
		
			432 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			432 B
		
	
	
	
		
			Go
		
	
	
	
	
	
// Copyright 2017 The Gitea Authors. All rights reserved.
 | 
						|
// SPDX-License-Identifier: MIT
 | 
						|
 | 
						|
package test
 | 
						|
 | 
						|
import (
 | 
						|
	"net/http"
 | 
						|
	"strings"
 | 
						|
)
 | 
						|
 | 
						|
// RedirectURL returns the redirect URL of a http response.
 | 
						|
func RedirectURL(resp http.ResponseWriter) string {
 | 
						|
	return resp.Header().Get("Location")
 | 
						|
}
 | 
						|
 | 
						|
func IsNormalPageCompleted(s string) bool {
 | 
						|
	return strings.Contains(s, `<footer class="page-footer"`) && strings.Contains(s, `</html>`)
 | 
						|
}
 |