mirror of
https://github.com/gofiber/fiber.git
synced 2025-02-24 03:23:56 +00:00
commit
f60c61cd07
14
.github/README.md
vendored
14
.github/README.md
vendored
@ -551,20 +551,10 @@ If you want to say **thank you** and/or support the active development of `Fiber
|
||||
<img src="https://github.com/gofiber/docs/blob/master/static/buy-morning-coffee-3x.gif" alt="Buy Me A Coffee" height="100" >
|
||||
</a>
|
||||
|
||||
## ⭐️ Stars
|
||||
## 💻 Code Contributors
|
||||
|
||||
<a href="https://starchart.cc/gofiber/fiber" rel="nofollow"><img src="https://starchart.cc/gofiber/fiber.svg" alt="Stars over time" style="max-width:100%;"></a>
|
||||
<img src="https://opencollective.com/fiber/contributors.svg?width=890&button=false" alt="Code Contributors" style="max-width:100%;">
|
||||
|
||||
## ⚠️ License
|
||||
|
||||
`Fiber` is free and open-source software licensed under the [MIT License](https://github.com/gofiber/fiber/blob/master/LICENSE) Copyright (c) 2019-present [Fenny](https://github.com/fenny) and [Fiber Contributors](https://github.com/gofiber/fiber/graphs/contributors). Official logo was created by [Vic Shóstak](https://github.com/koddr) and distributed under [Creative Commons](https://creativecommons.org/licenses/by-sa/4.0/) license (CC BY-SA 4.0 International).
|
||||
|
||||
<br>
|
||||
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/0)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/1)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/2)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/3)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/4)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/5)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/6)
|
||||
|
16
.github/README_de.md
vendored
16
.github/README_de.md
vendored
@ -546,20 +546,10 @@ Falls du **danke** sagen möchtest und/oder aktiv die Entwicklung von `fiber` f
|
||||
<img src="https://github.com/gofiber/docs/blob/master/static/buy-morning-coffee-3x.gif" alt="Buy Me A Coffee" height="100" >
|
||||
</a>
|
||||
|
||||
## ⭐️ Sterne
|
||||
## 💻 Code Contributors
|
||||
|
||||
<a href="https://starchart.cc/gofiber/fiber" rel="nofollow"><img src="https://starchart.cc/gofiber/fiber.svg" alt="Stars over time" style="max-width:100%;"></a>
|
||||
<img src="https://opencollective.com/fiber/contributors.svg?width=890&button=false" alt="Code Contributors" style="max-width:100%;">
|
||||
|
||||
## ⚠️ Lizenz
|
||||
## ⚠️ License
|
||||
|
||||
`Fiber` is free and open-source software licensed under the [MIT License](https://github.com/gofiber/fiber/blob/master/LICENSE) Copyright (c) 2019-present [Fenny](https://github.com/fenny) and [Fiber Contributors](https://github.com/gofiber/fiber/graphs/contributors). Official logo was created by [Vic Shóstak](https://github.com/koddr) and distributed under [Creative Commons](https://creativecommons.org/licenses/by-sa/4.0/) license (CC BY-SA 4.0 International).
|
||||
|
||||
<br>
|
||||
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/0)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/1)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/2)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/3)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/4)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/5)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/6)
|
16
.github/README_es.md
vendored
16
.github/README_es.md
vendored
@ -525,20 +525,10 @@ Si quiere **agradecer** y/o apoyar el desarrollo activo de la `Fiber`:
|
||||
<img src="https://github.com/gofiber/docs/blob/master/static/buy-morning-coffee-3x.gif" alt="Buy Me A Coffee" height="100" >
|
||||
</a>
|
||||
|
||||
## ⭐️ Estrellas
|
||||
## 💻 Code Contributors
|
||||
|
||||
<a href="https://starchart.cc/gofiber/fiber" rel="nofollow"><img src="https://starchart.cc/gofiber/fiber.svg" alt="Stars over time" style="max-width:100%;"></a>
|
||||
<img src="https://opencollective.com/fiber/contributors.svg?width=890&button=false" alt="Code Contributors" style="max-width:100%;">
|
||||
|
||||
## Licencia
|
||||
## ⚠️ License
|
||||
|
||||
`Fiber` is free and open-source software licensed under the [MIT License](https://github.com/gofiber/fiber/blob/master/LICENSE) Copyright (c) 2019-present [Fenny](https://github.com/fenny) and [Fiber Contributors](https://github.com/gofiber/fiber/graphs/contributors). Official logo was created by [Vic Shóstak](https://github.com/koddr) and distributed under [Creative Commons](https://creativecommons.org/licenses/by-sa/4.0/) license (CC BY-SA 4.0 International).
|
||||
|
||||
<br>
|
||||
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/0)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/1)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/2)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/3)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/4)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/5)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/6)
|
16
.github/README_fr.md
vendored
16
.github/README_fr.md
vendored
@ -525,20 +525,10 @@ Si vous voulez nous remercier et/ou soutenir le développement actif de `Fiber`:
|
||||
<img src="https://github.com/gofiber/docs/blob/master/static/buy-morning-coffee-3x.gif" alt="Buy Me A Coffee" height="100" >
|
||||
</a>
|
||||
|
||||
## ⭐️ Stars
|
||||
## 💻 Code Contributors
|
||||
|
||||
<a href="https://starchart.cc/gofiber/fiber" rel="nofollow"><img src="https://starchart.cc/gofiber/fiber.svg" alt="Stars over time" style="max-width:100%;"></a>
|
||||
<img src="https://opencollective.com/fiber/contributors.svg?width=890&button=false" alt="Code Contributors" style="max-width:100%;">
|
||||
|
||||
## ⚠️ Licence
|
||||
## ⚠️ License
|
||||
|
||||
`Fiber` is free and open-source software licensed under the [MIT License](https://github.com/gofiber/fiber/blob/master/LICENSE) Copyright (c) 2019-present [Fenny](https://github.com/fenny) and [Fiber Contributors](https://github.com/gofiber/fiber/graphs/contributors). Official logo was created by [Vic Shóstak](https://github.com/koddr) and distributed under [Creative Commons](https://creativecommons.org/licenses/by-sa/4.0/) license (CC BY-SA 4.0 International).
|
||||
|
||||
<br>
|
||||
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/0)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/1)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/2)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/3)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/4)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/5)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/6)
|
16
.github/README_id.md
vendored
16
.github/README_id.md
vendored
@ -529,20 +529,10 @@ Apabila anda ingin mengucapkan **terima kasih** dan/atau mendukung pengembangan
|
||||
<img src="https://github.com/gofiber/docs/blob/master/static/buy-morning-coffee-3x.gif" alt="Buy Me A Coffee" height="100" >
|
||||
</a>
|
||||
|
||||
## ⭐️ Bintang
|
||||
## 💻 Code Contributors
|
||||
|
||||
<a href="https://starchart.cc/gofiber/fiber" rel="nofollow"><img src="https://starchart.cc/gofiber/fiber.svg" alt="Stars over time" style="max-width:100%;"></a>
|
||||
<img src="https://opencollective.com/fiber/contributors.svg?width=890&button=false" alt="Code Contributors" style="max-width:100%;">
|
||||
|
||||
## ⚠️ Lisensi
|
||||
## ⚠️ License
|
||||
|
||||
`Fiber` is free and open-source software licensed under the [MIT License](https://github.com/gofiber/fiber/blob/master/LICENSE) Copyright (c) 2019-present [Fenny](https://github.com/fenny) and [Fiber Contributors](https://github.com/gofiber/fiber/graphs/contributors). Official logo was created by [Vic Shóstak](https://github.com/koddr) and distributed under [Creative Commons](https://creativecommons.org/licenses/by-sa/4.0/) license (CC BY-SA 4.0 International).
|
||||
|
||||
<br>
|
||||
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/0)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/1)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/2)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/3)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/4)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/5)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/6)
|
16
.github/README_ja.md
vendored
16
.github/README_ja.md
vendored
@ -531,20 +531,10 @@ func main() {
|
||||
<img src="https://github.com/gofiber/docs/blob/master/static/buy-morning-coffee-3x.gif" alt="Buy Me A Coffee" height="100" >
|
||||
</a>
|
||||
|
||||
## ⭐️ スター
|
||||
## 💻 Code Contributors
|
||||
|
||||
<a href="https://starchart.cc/gofiber/fiber" rel="nofollow"><img src="https://starchart.cc/gofiber/fiber.svg" alt="Stars over time" style="max-width:100%;"></a>
|
||||
<img src="https://opencollective.com/fiber/contributors.svg?width=890&button=false" alt="Code Contributors" style="max-width:100%;">
|
||||
|
||||
## ⚠️ ライセンス
|
||||
## ⚠️ License
|
||||
|
||||
`Fiber` is free and open-source software licensed under the [MIT License](https://github.com/gofiber/fiber/blob/master/LICENSE) Copyright (c) 2019-present [Fenny](https://github.com/fenny) and [Fiber Contributors](https://github.com/gofiber/fiber/graphs/contributors). Official logo was created by [Vic Shóstak](https://github.com/koddr) and distributed under [Creative Commons](https://creativecommons.org/licenses/by-sa/4.0/) license (CC BY-SA 4.0 International).
|
||||
|
||||
<br>
|
||||
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/0)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/1)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/2)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/3)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/4)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/5)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/6)
|
16
.github/README_ko.md
vendored
16
.github/README_ko.md
vendored
@ -531,20 +531,10 @@ func main() {
|
||||
<img src="https://github.com/gofiber/docs/blob/master/static/buy-morning-coffee-3x.gif" alt="Buy Me A Coffee" height="100" >
|
||||
</a>
|
||||
|
||||
## ⭐️ Stars
|
||||
## 💻 Code Contributors
|
||||
|
||||
<a href="https://starchart.cc/gofiber/fiber" rel="nofollow"><img src="https://starchart.cc/gofiber/fiber.svg" alt="Stars over time" style="max-width:100%;"></a>
|
||||
<img src="https://opencollective.com/fiber/contributors.svg?width=890&button=false" alt="Code Contributors" style="max-width:100%;">
|
||||
|
||||
## ⚠️ 라이센스
|
||||
## ⚠️ License
|
||||
|
||||
`Fiber` is free and open-source software licensed under the [MIT License](https://github.com/gofiber/fiber/blob/master/LICENSE) Copyright (c) 2019-present [Fenny](https://github.com/fenny) and [Fiber Contributors](https://github.com/gofiber/fiber/graphs/contributors). Official logo was created by [Vic Shóstak](https://github.com/koddr) and distributed under [Creative Commons](https://creativecommons.org/licenses/by-sa/4.0/) license (CC BY-SA 4.0 International).
|
||||
|
||||
<br>
|
||||
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/0)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/1)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/2)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/3)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/4)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/5)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/6)
|
16
.github/README_pt.md
vendored
16
.github/README_pt.md
vendored
@ -525,20 +525,10 @@ Se você quer **agradecer** e/ou apoiar o desenvolvimento ativo do `Fiber`:
|
||||
<img src="https://github.com/gofiber/docs/blob/master/static/buy-morning-coffee-3x.gif" alt="Buy Me A Coffee" height="100" >
|
||||
</a>
|
||||
|
||||
## ⭐️ Estrelas
|
||||
## 💻 Code Contributors
|
||||
|
||||
<a href="https://starchart.cc/gofiber/fiber" rel="nofollow"><img src="https://starchart.cc/gofiber/fiber.svg" alt="Stars over time" style="max-width:100%;"></a>
|
||||
<img src="https://opencollective.com/fiber/contributors.svg?width=890&button=false" alt="Code Contributors" style="max-width:100%;">
|
||||
|
||||
## ⚠️ Licença
|
||||
## ⚠️ License
|
||||
|
||||
`Fiber` is free and open-source software licensed under the [MIT License](https://github.com/gofiber/fiber/blob/master/LICENSE) Copyright (c) 2019-present [Fenny](https://github.com/fenny) and [Fiber Contributors](https://github.com/gofiber/fiber/graphs/contributors). Official logo was created by [Vic Shóstak](https://github.com/koddr) and distributed under [Creative Commons](https://creativecommons.org/licenses/by-sa/4.0/) license (CC BY-SA 4.0 International).
|
||||
|
||||
<br>
|
||||
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/0)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/1)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/2)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/3)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/4)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/5)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/6)
|
16
.github/README_ru.md
vendored
16
.github/README_ru.md
vendored
@ -548,20 +548,10 @@ func main() {
|
||||
<img src="https://github.com/gofiber/docs/blob/master/static/buy-morning-coffee-3x.gif" alt="Buy Me A Coffee" height="100" >
|
||||
</a>
|
||||
|
||||
## ⭐️ Звезды
|
||||
## 💻 Code Contributors
|
||||
|
||||
<a href="https://starchart.cc/gofiber/fiber" rel="nofollow"><img src="https://starchart.cc/gofiber/fiber.svg" alt="Stars over time" style="max-width:100%;"></a>
|
||||
<img src="https://opencollective.com/fiber/contributors.svg?width=890&button=false" alt="Code Contributors" style="max-width:100%;">
|
||||
|
||||
## ⚠️ Лицензия
|
||||
## ⚠️ License
|
||||
|
||||
`Fiber` is free and open-source software licensed under the [MIT License](https://github.com/gofiber/fiber/blob/master/LICENSE) Copyright (c) 2019-present [Fenny](https://github.com/fenny) and [Fiber Contributors](https://github.com/gofiber/fiber/graphs/contributors). Official logo was created by [Vic Shóstak](https://github.com/koddr) and distributed under [Creative Commons](https://creativecommons.org/licenses/by-sa/4.0/) license (CC BY-SA 4.0 International).
|
||||
|
||||
<br>
|
||||
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/0)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/1)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/2)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/3)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/4)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/5)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/6)
|
16
.github/README_tr.md
vendored
16
.github/README_tr.md
vendored
@ -526,20 +526,10 @@ Eğer **teşekkür etmek** ve/veya `Fiber` ın aktif geliştirilmesini destekle
|
||||
<img src="https://github.com/gofiber/docs/blob/master/static/buy-morning-coffee-3x.gif" alt="Buy Me A Coffee" height="100" >
|
||||
</a>
|
||||
|
||||
## ⭐️ Yıldızlar
|
||||
## 💻 Code Contributors
|
||||
|
||||
<a href="https://starchart.cc/gofiber/fiber" rel="nofollow"><img src="https://starchart.cc/gofiber/fiber.svg" alt="Zamana göre yıldız sayısı" style="max-width:100%;"></a>
|
||||
<img src="https://opencollective.com/fiber/contributors.svg?width=890&button=false" alt="Code Contributors" style="max-width:100%;">
|
||||
|
||||
## ⚠️ Lisans
|
||||
## ⚠️ License
|
||||
|
||||
`Fiber` is free and open-source software licensed under the [MIT License](https://github.com/gofiber/fiber/blob/master/LICENSE) Copyright (c) 2019-present [Fenny](https://github.com/fenny) and [Fiber Contributors](https://github.com/gofiber/fiber/graphs/contributors). Official logo was created by [Vic Shóstak](https://github.com/koddr) and distributed under [Creative Commons](https://creativecommons.org/licenses/by-sa/4.0/) license (CC BY-SA 4.0 International).
|
||||
|
||||
<br>
|
||||
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/0)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/1)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/2)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/3)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/4)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/5)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/6)
|
16
.github/README_zh-CN.md
vendored
16
.github/README_zh-CN.md
vendored
@ -528,20 +528,10 @@ func main() {
|
||||
<img src="https://github.com/gofiber/docs/blob/master/static/buy-morning-coffee-3x.gif" alt="Buy Me A Coffee" height="100" >
|
||||
</a>
|
||||
|
||||
### ⭐️ 星星
|
||||
## 💻 Code Contributors
|
||||
|
||||
<a href="https://starchart.cc/gofiber/fiber" rel="nofollow"><img src="https://starchart.cc/gofiber/fiber.svg" alt="Stars over time" style="max-width:100%;"></a>
|
||||
<img src="https://opencollective.com/fiber/contributors.svg?width=890&button=false" alt="Code Contributors" style="max-width:100%;">
|
||||
|
||||
## ⚠️ 许可证
|
||||
## ⚠️ License
|
||||
|
||||
`Fiber` is free and open-source software licensed under the [MIT License](https://github.com/gofiber/fiber/blob/master/LICENSE) Copyright (c) 2019-present [Fenny](https://github.com/fenny) and [Fiber Contributors](https://github.com/gofiber/fiber/graphs/contributors). Official logo was created by [Vic Shóstak](https://github.com/koddr) and distributed under [Creative Commons](https://creativecommons.org/licenses/by-sa/4.0/) license (CC BY-SA 4.0 International).
|
||||
|
||||
<br>
|
||||
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/0)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/1)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/2)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/3)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/4)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/5)
|
||||
[](https://sourcerer.io/fame/Fenny/gofiber/fiber/links/6)
|
||||
|
6
ctx.go
6
ctx.go
@ -20,6 +20,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
schema "github.com/gorilla/schema"
|
||||
jsoniter "github.com/json-iterator/go"
|
||||
fasthttp "github.com/valyala/fasthttp"
|
||||
)
|
||||
@ -58,6 +59,10 @@ type Cookie struct {
|
||||
SameSite string
|
||||
}
|
||||
|
||||
// Global variables
|
||||
var jsonParser = jsoniter.ConfigCompatibleWithStandardLibrary
|
||||
var schemaDecoder = schema.NewDecoder()
|
||||
|
||||
// Ctx pool
|
||||
var poolCtx = sync.Pool{
|
||||
New: func() interface{} {
|
||||
@ -373,6 +378,7 @@ func (ctx *Ctx) Format(body interface{}) {
|
||||
ctx.SendString("<p>" + b + "</p>")
|
||||
case "json":
|
||||
if err := ctx.JSON(body); err != nil {
|
||||
// Fix
|
||||
log.Println("Format: error serializing json ", err)
|
||||
}
|
||||
default:
|
||||
|
12
fiber.go
12
fiber.go
@ -24,7 +24,7 @@ import (
|
||||
)
|
||||
|
||||
// Version of current package
|
||||
const Version = "1.8.42"
|
||||
const Version = "1.8.43"
|
||||
|
||||
// Map is a shortcut for map[string]interface{}
|
||||
type Map map[string]interface{}
|
||||
@ -70,6 +70,9 @@ type Group struct {
|
||||
app *Fiber
|
||||
}
|
||||
|
||||
// Global variables
|
||||
var isPrefork, isChild bool
|
||||
|
||||
// New creates a new Fiber named instance.
|
||||
// You can pass optional settings when creating a new instance.
|
||||
func New(settings ...*Settings) *Fiber {
|
||||
@ -465,6 +468,12 @@ func (app *Fiber) prefork(address string) (ln net.Listener, err error) {
|
||||
return ln, err
|
||||
}
|
||||
|
||||
type disableLogger struct{}
|
||||
|
||||
func (dl *disableLogger) Printf(format string, args ...interface{}) {
|
||||
// fmt.Println(fmt.Sprintf(format, args...))
|
||||
}
|
||||
|
||||
func (app *Fiber) newServer() *fasthttp.Server {
|
||||
return &fasthttp.Server{
|
||||
Handler: app.handler,
|
||||
@ -474,6 +483,7 @@ func (app *Fiber) newServer() *fasthttp.Server {
|
||||
ReadTimeout: app.Settings.ReadTimeout,
|
||||
WriteTimeout: app.Settings.WriteTimeout,
|
||||
IdleTimeout: app.Settings.IdleTimeout,
|
||||
Logger: &disableLogger{},
|
||||
LogAllErrors: false,
|
||||
ErrorHandler: func(ctx *fasthttp.RequestCtx, err error) {
|
||||
if err.Error() == "body size exceeds the given limit" {
|
||||
|
@ -265,6 +265,8 @@ func (app *Fiber) registerStatic(prefix, root string, config ...Static) {
|
||||
if c.Fasthttp.Response.StatusCode() != 404 {
|
||||
return
|
||||
}
|
||||
// Reset response
|
||||
c.Fasthttp.Response.Reset()
|
||||
}
|
||||
c.Next()
|
||||
},
|
||||
|
7
utils.go
7
utils.go
@ -14,15 +14,8 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
"unsafe"
|
||||
|
||||
schema "github.com/gorilla/schema"
|
||||
jsoniter "github.com/json-iterator/go"
|
||||
)
|
||||
|
||||
var isPrefork, isChild bool
|
||||
var jsonParser = jsoniter.ConfigCompatibleWithStandardLibrary
|
||||
var schemaDecoder = schema.NewDecoder()
|
||||
|
||||
func groupPaths(prefix, path string) string {
|
||||
if path == "/" {
|
||||
path = ""
|
||||
|
Loading…
x
Reference in New Issue
Block a user