Removed isTestDomain (#3069)
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
34beaa569b
Коммит
8e5c318590
@@ -457,70 +457,6 @@ func GetIpAddress(r *http.Request) string {
|
|||||||
return address
|
return address
|
||||||
}
|
}
|
||||||
|
|
||||||
// func IsTestDomain(r *http.Request) bool {
|
|
||||||
|
|
||||||
// if strings.Index(r.Host, "localhost") == 0 {
|
|
||||||
// return true
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if strings.Index(r.Host, "dockerhost") == 0 {
|
|
||||||
// return true
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if strings.Index(r.Host, "test") == 0 {
|
|
||||||
// return true
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if strings.Index(r.Host, "127.0.") == 0 {
|
|
||||||
// return true
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if strings.Index(r.Host, "192.168.") == 0 {
|
|
||||||
// return true
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if strings.Index(r.Host, "10.") == 0 {
|
|
||||||
// return true
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if strings.Index(r.Host, "176.") == 0 {
|
|
||||||
// return true
|
|
||||||
// }
|
|
||||||
|
|
||||||
// return false
|
|
||||||
// }
|
|
||||||
|
|
||||||
// func IsBetaDomain(r *http.Request) bool {
|
|
||||||
|
|
||||||
// if strings.Index(r.Host, "beta") == 0 {
|
|
||||||
// return true
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if strings.Index(r.Host, "ci") == 0 {
|
|
||||||
// return true
|
|
||||||
// }
|
|
||||||
|
|
||||||
// return false
|
|
||||||
// }
|
|
||||||
|
|
||||||
// var privateIpAddress = []*net.IPNet{
|
|
||||||
// {IP: net.IPv4(10, 0, 0, 1), Mask: net.IPv4Mask(255, 0, 0, 0)},
|
|
||||||
// {IP: net.IPv4(176, 16, 0, 1), Mask: net.IPv4Mask(255, 255, 0, 0)},
|
|
||||||
// {IP: net.IPv4(192, 168, 0, 1), Mask: net.IPv4Mask(255, 255, 255, 0)},
|
|
||||||
// {IP: net.IPv4(127, 0, 0, 1), Mask: net.IPv4Mask(255, 255, 255, 252)},
|
|
||||||
// }
|
|
||||||
|
|
||||||
// func IsPrivateIpAddress(ipAddress string) bool {
|
|
||||||
|
|
||||||
// for _, pips := range privateIpAddress {
|
|
||||||
// if pips.Contains(net.ParseIP(ipAddress)) {
|
|
||||||
// return true
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// return false
|
|
||||||
// }
|
|
||||||
|
|
||||||
func RenderWebError(err *model.AppError, w http.ResponseWriter, r *http.Request) {
|
func RenderWebError(err *model.AppError, w http.ResponseWriter, r *http.Request) {
|
||||||
T, _ := utils.GetTranslationsAndLocale(w, r)
|
T, _ := utils.GetTranslationsAndLocale(w, r)
|
||||||
|
|
||||||
|
|||||||
@@ -34,38 +34,6 @@ export function cleanUpUrlable(input) {
|
|||||||
return cleaned;
|
return cleaned;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isTestDomain() {
|
|
||||||
if ((/^localhost/).test(window.location.hostname)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((/^dockerhost/).test(window.location.hostname)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((/^test/).test(window.location.hostname)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((/^127.0./).test(window.location.hostname)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((/^192.168./).test(window.location.hostname)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((/^10./).test(window.location.hostname)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((/^176./).test(window.location.hostname)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function isChrome() {
|
export function isChrome() {
|
||||||
if (navigator.userAgent.indexOf('Chrome') > -1) {
|
if (navigator.userAgent.indexOf('Chrome') > -1) {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user