diff --git a/go.mod b/go.mod index 898b679f..89aa1a4d 100644 --- a/go.mod +++ b/go.mod @@ -4,5 +4,5 @@ go 1.11 require ( github.com/json-iterator/go v1.1.9 - github.com/valyala/fasthttp v1.8.0 + github.com/valyala/fasthttp v1.9.0 ) diff --git a/go.sum b/go.sum index 1d05fb6b..4f5f5e7a 100644 --- a/go.sum +++ b/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/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= 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.8.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= +github.com/valyala/fasthttp v1.9.0 h1:hNpmUdy/+ZXYpGy0OBfm7K0UQTzb73W0T0U4iJIVrMw= +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/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= diff --git a/middleware/helmet.go b/middleware/helmet.go index 620396f4..af5ddfa6 100644 --- a/middleware/helmet.go +++ b/middleware/helmet.go @@ -3,11 +3,13 @@ package middleware import ( "fmt" - "github.com/gofiber/fiber" + "github.com/fenny/fiber" ) // Helmet : Helps secure your apps by setting various HTTP headers. -func Helmet(c *fiber.Ctx) { - fmt.Println("Helmet is still under development, this middleware does nothing yet.") - c.Next() +func Helmet() func(*fiber.Midware) { + return func(c *fiber.Midware) { + fmt.Println("Helmet is still under development, this middleware does nothing yet.") + c.Next() + } } diff --git a/router.go b/router.go index 01377d24..4c37d453 100644 --- a/router.go +++ b/router.go @@ -48,6 +48,14 @@ func (r *Fiber) register(method string, args ...interface{}) { // Only 1 argument, so no path/prefix 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)) } else if len(args) > 1 { path = args[0].(string)