diff --git a/DONATIONS.md b/DONATIONS.md index 5b44fd4b..c67c1a59 100644 --- a/DONATIONS.md +++ b/DONATIONS.md @@ -27,6 +27,7 @@ I'm grateful for all the generous donations. Iris is fully funded by these dona - [Ryan Brooks](https://github.com/ryanbyyc) donated 50 EUR at May 11 - [Juan Sebastián Suárez Valencia](https://github.com/Juanses) donated 20 EUR at September 11 - [Bob Lee](https://github.com/li3p) donated 20 EUR at September 16 +- [Celso Luiz](https://github.com/celsosz) donated 50 EUR at September 29 > The name of the donator added after his/her permission. @@ -35,4 +36,4 @@ I'm grateful for all the generous donations. Iris is fully funded by these dona - 13 EUR for the domain, [iris-go.com](https://iris-go.com) -**Available**: VAT(50) + VAT(20) + VAT(20) - 13 = 47,45 + 18,97 + 18,61 - 13 = 72,03 EUR +**Available**: VAT(50) + VAT(20) + VAT(20) + VAT(50) - 13 = 47,45 + 18,97 + 18,61 + 47,05 - 13 = 119,08 EUR diff --git a/HISTORY.md b/HISTORY.md index 5c363e9b..1f34fd8e 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -8,21 +8,21 @@ ```go // ... - iris.UsePreRender(func(ctx *iris.Context, filename string, binding interface{}, options ...map[string]interface{}) bool { - // put the 'Error' binding here, for the shake of the test - if b, isMap := binding.(map[string]interface{}); isMap { - b["Error"] = "error!" - } - // true= continue to the next PreRender - // false= do not continue to the next PreRender - // * but the actual Render will be called at any case * - return true - }) +iris.UsePreRender(func(ctx *iris.Context, filename string, binding interface{}, options ...map[string]interface{}) bool { + // put the 'Error' binding here, for the shake of the test + if b, isMap := binding.(map[string]interface{}); isMap { + b["Error"] = "error!" + } + // true= continue to the next PreRender + // false= do not continue to the next PreRender + // * but the actual Render will be called at any case * + return true +}) - iris.Get("/", func(ctx *Context) { - ctx.Render("hi.html", map[string]interface{}{"Username": "anybody"}) - // hi.html:

HI {{.Username}}. Error: {{.Error}}

- }) +iris.Get("/", func(ctx *Context) { + ctx.Render("hi.html", map[string]interface{}{"Username": "anybody"}) + // hi.html:

HI {{.Username}}. Error: {{.Error}}

+}) // ... ``` diff --git a/configuration.go b/configuration.go index c52a7adb..d6d985ec 100644 --- a/configuration.go +++ b/configuration.go @@ -499,14 +499,13 @@ const ( // // Default buffer size is 8MB DefaultWriteBufferSize = 8096 - - // DefaultServerName the response header of the 'Server' value when writes to the client - DefaultServerName = "iris" ) var ( // DefaultLoggerOut is the default logger's output DefaultLoggerOut = os.Stdout + // DefaultServerName the response header of the 'Server' value when writes to the client + DefaultServerName = "" ) // DefaultConfiguration returns the default configuration for an Iris station, fills the main Configuration diff --git a/iris.go b/iris.go index 76c54536..66e7e6b0 100644 --- a/iris.go +++ b/iris.go @@ -362,7 +362,11 @@ func (s *Framework) Build() { if s.ln != nil { // user called Listen functions or Serve, // create the main server - s.fsrv = &fasthttp.Server{Name: DefaultServerName, + srvName := "iris" + if len(DefaultServerName) > 0 { + srvName += "_" + DefaultServerName + } + s.fsrv = &fasthttp.Server{Name: srvName, MaxRequestBodySize: s.Config.MaxRequestBodySize, ReadBufferSize: s.Config.ReadBufferSize, WriteBufferSize: s.Config.WriteBufferSize, diff --git a/template.go b/template.go index cb395587..8776fc26 100644 --- a/template.go +++ b/template.go @@ -62,9 +62,6 @@ func getCharsetOption(defaultValue string, options map[string]interface{}) strin } func (t *templateEngines) usePreRender(pre PreRender) { - if t.prerenders == nil { - t.prerenders = make([]PreRender, 0) - } t.prerenders = append(t.prerenders, pre) }