mirror of https://github.com/gofiber/fiber.git
fix mws
parent
967e52a5e0
commit
8e6b3bb2e4
8
app.go
8
app.go
|
@ -385,12 +385,6 @@ type Config struct {
|
|||
// Optional. Default: DefaultColors
|
||||
ColorScheme Colors `json:"color_scheme"`
|
||||
|
||||
// If you want to validate header/form/query... automatically when to bind, you can define struct validator.
|
||||
// Fiber doesn't have default validator, so it'll skip validator step if you don't use any validator.
|
||||
//
|
||||
// Default: nil
|
||||
StructValidator StructValidator
|
||||
|
||||
// RequestMethods provides customizibility for HTTP methods. You can add/remove methods as you wish.
|
||||
//
|
||||
// Optional. Default: DefaultMethods
|
||||
|
@ -725,8 +719,6 @@ func (app *App) Use(args ...any) Router {
|
|||
app.register([]string{methodUse}, prefix, nil, nil, handlers...)
|
||||
}
|
||||
|
||||
app.register([]string{methodUse}, prefix, nil, handlers...)
|
||||
|
||||
return app
|
||||
}
|
||||
|
||||
|
|
|
@ -116,11 +116,7 @@ func New(config ...Config) fiber.Handler {
|
|||
Body: utils.CopyBytes(c.Response().Body()),
|
||||
}
|
||||
{
|
||||
headers := make(map[string]string)
|
||||
if err := c.Bind().RespHeader(headers); err != nil {
|
||||
return fmt.Errorf("failed to bind to response headers: %w", err)
|
||||
}
|
||||
|
||||
headers := c.GetRespHeaders()
|
||||
if cfg.KeepResponseHeaders == nil {
|
||||
// Keep all
|
||||
res.Headers = headers
|
||||
|
|
|
@ -102,11 +102,7 @@ func createTagMap(cfg *Config) map[string]LogFunc {
|
|||
return output.Write(c.Response().Body())
|
||||
},
|
||||
TagReqHeaders: func(output Buffer, c fiber.Ctx, data *Data, extraParam string) (int, error) {
|
||||
out := make(map[string]string, 0)
|
||||
if err := c.Bind().Header(&out); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
out := c.GetReqHeaders()
|
||||
reqHeaders := make([]string, 0)
|
||||
for k, v := range out {
|
||||
reqHeaders = append(reqHeaders, k+"="+v)
|
||||
|
|
Loading…
Reference in New Issue