Skip to content

Commit

Permalink
fix mws
Browse files Browse the repository at this point in the history
  • Loading branch information
efectn committed Aug 6, 2023
1 parent 967e52a commit 8e6b3bb
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 18 deletions.
8 changes: 0 additions & 8 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}

Expand Down
6 changes: 1 addition & 5 deletions middleware/idempotency/idempotency.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions middleware/logger/tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8e6b3bb

Please sign in to comment.