Former-commit-id: de1a500475a9d6f96e86445cfb9e85a57a65d1c2
This commit is contained in:
Gerasimos (Makis) Maropoulos 2020-01-05 18:27:21 +02:00
parent 3d358a4867
commit 79a965ec2d
4 changed files with 10 additions and 5 deletions

1
.gitattributes vendored
View File

@ -1,6 +1,7 @@
*.go linguist-language=Go
_examples/* linguist-documentation
_benchmarks/* linguist-documentation
go.sum linguist-generated
# Set the default behavior, in case people don't have core.autocrlf set.
# if from windows:
# git config --global core.autocrlf true

View File

@ -1,10 +1,8 @@
# Happy New Year!
It's my **birthday today** and I wish good luck and well health to all and especially to those who are being tested!
![](https://iris-go.com/images/release.png) Iris version **12.1.4** has been [released](HISTORY.md#su-29-december-2019--v1214)!
![](https://iris-go.com/images/cli.png) The official Iris Command Line Interface will soon be near you in 2020!
![](https://iris-go.com/images/cli.png) The official [Iris Command Line Interface](https://github.com/kataras/iris-cli) will soon be near you in 2020!
![](https://iris-go.com/images/sponsor.png) Support your favorite web framework through [Github Sponsors Program](https://github.com/sponsors/kataras)!
@ -24,6 +22,8 @@ Learn what [others saying about Iris](https://iris-go.com/testimonials/) and **[
<summary>Quick start</summary>
```sh
# https://github.com/kataras/iris/wiki/Installation
$ go get github.com/kataras/iris/v12@latest
# assume the following code in example.go file
$ cat example.go
```

View File

@ -556,7 +556,7 @@ Run the Iris web server you've just created by executing `go run main.go` from y
```sh
$ go run main.go
Now listening on: http://0.0.0.0:8080
Now listening on: http://localhost:8080
Application Started. Press CTRL+C to shut down.
_
```

View File

@ -157,7 +157,7 @@ func ResolveVHost(addr string) string {
if idx := strings.IndexByte(addr, ':'); idx == 0 {
// only port, then return the 0.0.0.0
return "0.0.0.0" + addr[idx:]
return /* "0.0.0.0" */ "localhost" + addr[idx:]
}
// with ':' in order to not replace the ipv6 loopback addresses
@ -215,5 +215,9 @@ func ResolveSchemeFromVHost(vhost string) string {
// and returns its URL, pure implementation but it does the job.
func ResolveURL(scheme string, addr string) string {
host := ResolveVHost(addr)
if host == "0.0.0.0" {
host = "localhost"
}
return scheme + "://" + host
}