Skip to content

Commit

Permalink
Merge pull request #290 from Fenny/master
Browse files Browse the repository at this point in the history
v1.9.2
  • Loading branch information
Fenny authored Apr 24, 2020
2 parents 54d36d5 + afeb302 commit 5410267
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
<a href="https://github.com/gofiber/fiber/blob/master/.github/README_de.md">
<img height="20px" src="https://github.com/gofiber/docs/blob/master/static/flags/de.svg">
</a>
<a href="https://github.com/gofiber/fiber/blob/master/.github/README_nl.md">
<img height="20px" src="https://github.com/gofiber/docs/blob/master/static/flags/nl.svg">
</a>
<a href="https://github.com/gofiber/fiber/blob/master/.github/README_ko.md">
<img height="20px" src="https://github.com/gofiber/docs/blob/master/static/flags/ko.svg">
</a>
Expand Down
4 changes: 3 additions & 1 deletion ctx.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ func (ctx *Ctx) Body(key ...string) string {
}
// Return post value by key
if len(key) > 0 {
fmt.Println("DEPRECATED: c.Body(\"" + key[0] + "\") is deprecated, please use c.FormValue(\"" + key[0] + "\") instead.")
return getString(ctx.Fasthttp.Request.PostArgs().Peek(key[0]))
}
return ""
Expand Down Expand Up @@ -283,7 +284,7 @@ func (ctx *Ctx) BodyParser(out interface{}) error {
}
return schemaDecoderForm.Decode(out, data.Value)
}
// query Params
// query params
if ctx.Fasthttp.QueryArgs().Len() > 0 {
data := make(map[string][]string)
ctx.Fasthttp.QueryArgs().VisitAll(func(key []byte, val []byte) {
Expand Down Expand Up @@ -342,6 +343,7 @@ func (ctx *Ctx) Cookie(cookie *Cookie) {
// Cookies is used for getting a cookie value by key
func (ctx *Ctx) Cookies(key ...string) (value string) {
if len(key) == 0 {
fmt.Println("DEPRECATED: c.Cookies() without a key is deprecated, please use c.Get(\"Cookies\") to get the cookie header instead.")
return ctx.Get(HeaderCookie)
}
return getString(ctx.Fasthttp.Request.Header.Cookie(key[0]))
Expand Down

0 comments on commit 5410267

Please sign in to comment.