Skip to content

Commit 5410267

Browse files
authored
Merge pull request #290 from Fenny/master
v1.9.2
2 parents 54d36d5 + afeb302 commit 5410267

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.github/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
<a href="https://github.com/gofiber/fiber/blob/master/.github/README_de.md">
2525
<img height="20px" src="https://github.com/gofiber/docs/blob/master/static/flags/de.svg">
2626
</a>
27+
<a href="https://github.com/gofiber/fiber/blob/master/.github/README_nl.md">
28+
<img height="20px" src="https://github.com/gofiber/docs/blob/master/static/flags/nl.svg">
29+
</a>
2730
<a href="https://github.com/gofiber/fiber/blob/master/.github/README_ko.md">
2831
<img height="20px" src="https://github.com/gofiber/docs/blob/master/static/flags/ko.svg">
2932
</a>

ctx.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ func (ctx *Ctx) Body(key ...string) string {
248248
}
249249
// Return post value by key
250250
if len(key) > 0 {
251+
fmt.Println("DEPRECATED: c.Body(\"" + key[0] + "\") is deprecated, please use c.FormValue(\"" + key[0] + "\") instead.")
251252
return getString(ctx.Fasthttp.Request.PostArgs().Peek(key[0]))
252253
}
253254
return ""
@@ -283,7 +284,7 @@ func (ctx *Ctx) BodyParser(out interface{}) error {
283284
}
284285
return schemaDecoderForm.Decode(out, data.Value)
285286
}
286-
// query Params
287+
// query params
287288
if ctx.Fasthttp.QueryArgs().Len() > 0 {
288289
data := make(map[string][]string)
289290
ctx.Fasthttp.QueryArgs().VisitAll(func(key []byte, val []byte) {
@@ -342,6 +343,7 @@ func (ctx *Ctx) Cookie(cookie *Cookie) {
342343
// Cookies is used for getting a cookie value by key
343344
func (ctx *Ctx) Cookies(key ...string) (value string) {
344345
if len(key) == 0 {
346+
fmt.Println("DEPRECATED: c.Cookies() without a key is deprecated, please use c.Get(\"Cookies\") to get the cookie header instead.")
345347
return ctx.Get(HeaderCookie)
346348
}
347349
return getString(ctx.Fasthttp.Request.Header.Cookie(key[0]))

0 commit comments

Comments
 (0)