mirror of
https://github.com/kataras/iris.git
synced 2025-01-23 02:31:04 +01:00
minor
Former-commit-id: de1a500475a9d6f96e86445cfb9e85a57a65d1c2
This commit is contained in:
parent
3d358a4867
commit
79a965ec2d
1
.gitattributes
vendored
1
.gitattributes
vendored
|
@ -1,6 +1,7 @@
|
||||||
*.go linguist-language=Go
|
*.go linguist-language=Go
|
||||||
_examples/* linguist-documentation
|
_examples/* linguist-documentation
|
||||||
_benchmarks/* linguist-documentation
|
_benchmarks/* linguist-documentation
|
||||||
|
go.sum linguist-generated
|
||||||
# Set the default behavior, in case people don't have core.autocrlf set.
|
# Set the default behavior, in case people don't have core.autocrlf set.
|
||||||
# if from windows:
|
# if from windows:
|
||||||
# git config --global core.autocrlf true
|
# git config --global core.autocrlf true
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
# Happy New Year!
|
# 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/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)!
|
![](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>
|
<summary>Quick start</summary>
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
# https://github.com/kataras/iris/wiki/Installation
|
||||||
|
$ go get github.com/kataras/iris/v12@latest
|
||||||
# assume the following code in example.go file
|
# assume the following code in example.go file
|
||||||
$ cat example.go
|
$ cat example.go
|
||||||
```
|
```
|
||||||
|
|
|
@ -556,7 +556,7 @@ Run the Iris web server you've just created by executing `go run main.go` from y
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ go run main.go
|
$ 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.
|
Application Started. Press CTRL+C to shut down.
|
||||||
_
|
_
|
||||||
```
|
```
|
||||||
|
|
|
@ -157,7 +157,7 @@ func ResolveVHost(addr string) string {
|
||||||
|
|
||||||
if idx := strings.IndexByte(addr, ':'); idx == 0 {
|
if idx := strings.IndexByte(addr, ':'); idx == 0 {
|
||||||
// only port, then return the 0.0.0.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
|
// 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.
|
// and returns its URL, pure implementation but it does the job.
|
||||||
func ResolveURL(scheme string, addr string) string {
|
func ResolveURL(scheme string, addr string) string {
|
||||||
host := ResolveVHost(addr)
|
host := ResolveVHost(addr)
|
||||||
|
if host == "0.0.0.0" {
|
||||||
|
host = "localhost"
|
||||||
|
}
|
||||||
|
|
||||||
return scheme + "://" + host
|
return scheme + "://" + host
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user