From 79a965ec2da390d393ff8919c206882af5a11ef4 Mon Sep 17 00:00:00 2001 From: "Gerasimos (Makis) Maropoulos" Date: Sun, 5 Jan 2020 18:27:21 +0200 Subject: [PATCH] minor Former-commit-id: de1a500475a9d6f96e86445cfb9e85a57a65d1c2 --- .gitattributes | 1 + README.md | 6 +++--- _examples/tutorial/vuejs-todo-mvc/README.md | 2 +- core/netutil/addr.go | 6 +++++- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitattributes b/.gitattributes index 9b04f1bc..3dd9cee1 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/README.md b/README.md index 81bd20b9..a3cc224b 100644 --- a/README.md +++ b/README.md @@ -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 **[ Quick start ```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 ``` diff --git a/_examples/tutorial/vuejs-todo-mvc/README.md b/_examples/tutorial/vuejs-todo-mvc/README.md index 4de89a39..a768df37 100644 --- a/_examples/tutorial/vuejs-todo-mvc/README.md +++ b/_examples/tutorial/vuejs-todo-mvc/README.md @@ -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. _ ``` diff --git a/core/netutil/addr.go b/core/netutil/addr.go index 49167ff2..18ffcb09 100644 --- a/core/netutil/addr.go +++ b/core/netutil/addr.go @@ -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 }