mirror of
https://github.com/gofiber/fiber.git
synced 2025-05-31 11:52:41 +00:00
Update fasthttp v1.9.0
This commit is contained in:
parent
c508d99d41
commit
afeaecd044
2
go.mod
2
go.mod
@ -4,5 +4,5 @@ go 1.11
|
|||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/json-iterator/go v1.1.9
|
github.com/json-iterator/go v1.1.9
|
||||||
github.com/valyala/fasthttp v1.8.0
|
github.com/valyala/fasthttp v1.9.0
|
||||||
)
|
)
|
||||||
|
4
go.sum
4
go.sum
@ -16,8 +16,8 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
|
|||||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||||
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
|
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
|
||||||
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
|
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
|
||||||
github.com/valyala/fasthttp v1.8.0 h1:actnGGBYtGQmxVaZxyZpp57Vcc2NhcO7mMN0IMwCC0w=
|
github.com/valyala/fasthttp v1.9.0 h1:hNpmUdy/+ZXYpGy0OBfm7K0UQTzb73W0T0U4iJIVrMw=
|
||||||
github.com/valyala/fasthttp v1.8.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w=
|
github.com/valyala/fasthttp v1.9.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w=
|
||||||
github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a h1:0R4NLDRDZX6JcmhJgXi5E4b8Wg84ihbmUKp/GvSPEzc=
|
github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a h1:0R4NLDRDZX6JcmhJgXi5E4b8Wg84ihbmUKp/GvSPEzc=
|
||||||
github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio=
|
github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio=
|
||||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
|
@ -3,11 +3,13 @@ package middleware
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/gofiber/fiber"
|
"github.com/fenny/fiber"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Helmet : Helps secure your apps by setting various HTTP headers.
|
// Helmet : Helps secure your apps by setting various HTTP headers.
|
||||||
func Helmet(c *fiber.Ctx) {
|
func Helmet() func(*fiber.Midware) {
|
||||||
|
return func(c *fiber.Midware) {
|
||||||
fmt.Println("Helmet is still under development, this middleware does nothing yet.")
|
fmt.Println("Helmet is still under development, this middleware does nothing yet.")
|
||||||
c.Next()
|
c.Next()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,6 +48,14 @@ func (r *Fiber) register(method string, args ...interface{}) {
|
|||||||
|
|
||||||
// Only 1 argument, so no path/prefix
|
// Only 1 argument, so no path/prefix
|
||||||
if len(args) == 1 {
|
if len(args) == 1 {
|
||||||
|
// switch arg := args[0].(type) {
|
||||||
|
// case func(*Ctx):
|
||||||
|
// handler = arg
|
||||||
|
// case func(*fiber.Ctx):
|
||||||
|
// handler = arg
|
||||||
|
// default:
|
||||||
|
// panic("Invalid Context function")
|
||||||
|
// }
|
||||||
handler = args[0].(func(*Ctx))
|
handler = args[0].(func(*Ctx))
|
||||||
} else if len(args) > 1 {
|
} else if len(args) > 1 {
|
||||||
path = args[0].(string)
|
path = args[0].(string)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user