1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-23 12:57:05 +00:00

a bit linting and some tests are online again

Former-commit-id: bd5463a169a36b078dba1c1b6e7dd3ffbd627617
This commit is contained in:
kataras
2017-06-10 03:31:50 +03:00
parent f747c682b9
commit c4f5fae561
21 changed files with 522 additions and 42 deletions

View File

@@ -57,6 +57,10 @@ var IsLoopbackHost = func(requestHost string) bool {
// would probably not want to reach the server with different Application.Config.Addr than
// he/she declared.
portOrPathIdx := strings.LastIndexByte(requestHost, ':')
if portOrPathIdx == 0 { // 0.0.0.0:[...]/localhost:[...]/127.0.0.1:[...]/ipv6 local...
return true
}
// this will not catch ipv6 loopbacks like subdomain.0000:0:0000::01.1:8080
// but, again, is for developers only, is hard to try to navigate with something like this,
// and if that happened, I provide a way to override the whole "algorithm" to a custom one via "IsLoopbackHost".