@@ -855,7 +855,7 @@ func Test_Request_Patch(t *testing.T) {
855
855
func Test_Request_Header_With_Server (t * testing.T ) {
856
856
t .Parallel ()
857
857
handler := func (c fiber.Ctx ) error {
858
- c .Request () .Header .VisitAll (func (key , value []byte ) {
858
+ c .Context (). Request .Header .VisitAll (func (key , value []byte ) {
859
859
if k := string (key ); k == "K1" || k == "K2" {
860
860
_ , err := c .Write (key )
861
861
require .NoError (t , err )
@@ -885,7 +885,7 @@ func Test_Request_UserAgent_With_Server(t *testing.T) {
885
885
t .Parallel ()
886
886
887
887
handler := func (c fiber.Ctx ) error {
888
- return c .Send (c .Request (). Header . UserAgent ( ))
888
+ return c .SendString (c .Get ( fiber . HeaderUserAgent ))
889
889
}
890
890
891
891
t .Run ("default" , func (t * testing.T ) {
@@ -923,7 +923,7 @@ func Test_Request_Cookie_With_Server(t *testing.T) {
923
923
func Test_Request_Referer_With_Server (t * testing.T ) {
924
924
t .Parallel ()
925
925
handler := func (c fiber.Ctx ) error {
926
- return c .Send (c .Request (). Header . Referer ( ))
926
+ return c .SendString (c .Get ( fiber . HeaderReferer ))
927
927
}
928
928
929
929
wrapAgent := func (req * Request ) {
@@ -936,7 +936,7 @@ func Test_Request_Referer_With_Server(t *testing.T) {
936
936
func Test_Request_QueryString_With_Server (t * testing.T ) {
937
937
t .Parallel ()
938
938
handler := func (c fiber.Ctx ) error {
939
- return c .Send (c .Request ().URI ().QueryString ())
939
+ return c .Send (c .Context ().URI ().QueryString ())
940
940
}
941
941
942
942
wrapAgent := func (req * Request ) {
@@ -974,8 +974,8 @@ func Test_Request_Body_With_Server(t *testing.T) {
974
974
t .Parallel ()
975
975
testRequest (t ,
976
976
func (c fiber.Ctx ) error {
977
- require .Equal (t , "application/json" , string (c .Request (). Header . ContentType ( )))
978
- return c .SendString (string (c .Request ().Body ()))
977
+ require .Equal (t , "application/json" , string (c .Get ( fiber . HeaderContentType )))
978
+ return c .SendString (string (c .Req ().BodyRaw ()))
979
979
},
980
980
func (agent * Request ) {
981
981
agent .SetJSON (map [string ]string {
@@ -990,8 +990,8 @@ func Test_Request_Body_With_Server(t *testing.T) {
990
990
t .Parallel ()
991
991
testRequest (t ,
992
992
func (c fiber.Ctx ) error {
993
- require .Equal (t , "application/xml" , string ( c . Request (). Header . ContentType () ))
994
- return c .SendString (string (c .Request ().Body ()))
993
+ require .Equal (t , "application/xml" , c . Get ( fiber . HeaderContentType ))
994
+ return c .SendString (string (c .Req ().BodyRaw ()))
995
995
},
996
996
func (agent * Request ) {
997
997
type args struct {
@@ -1009,7 +1009,7 @@ func Test_Request_Body_With_Server(t *testing.T) {
1009
1009
t .Parallel ()
1010
1010
testRequest (t ,
1011
1011
func (c fiber.Ctx ) error {
1012
- require .Equal (t , fiber .MIMEApplicationForm , string (c .Request (). Header . ContentType ( )))
1012
+ require .Equal (t , fiber .MIMEApplicationForm , string (c .Get ( fiber . HeaderContentType )))
1013
1013
return c .Send ([]byte ("foo=" + c .FormValue ("foo" ) + "&bar=" + c .FormValue ("bar" ) + "&fiber=" + c .FormValue ("fiber" )))
1014
1014
},
1015
1015
func (agent * Request ) {
@@ -1033,7 +1033,7 @@ func Test_Request_Body_With_Server(t *testing.T) {
1033
1033
require .NoError (t , err )
1034
1034
require .Equal (t , "bar" , mf .Value ["foo" ][0 ])
1035
1035
1036
- return c .Send (c .Request ().Body ())
1036
+ return c .Send (c .Req ().Body ())
1037
1037
})
1038
1038
1039
1039
go start ()
@@ -1125,7 +1125,7 @@ func Test_Request_Body_With_Server(t *testing.T) {
1125
1125
reg := regexp .MustCompile (`multipart/form-data; boundary=[\-\w]{35}` )
1126
1126
require .True (t , reg .MatchString (c .Get (fiber .HeaderContentType )))
1127
1127
1128
- return c .Send (c .Request ().Body ())
1128
+ return c .Send (c .Req ().BodyRaw ())
1129
1129
})
1130
1130
1131
1131
go start ()
@@ -1150,7 +1150,7 @@ func Test_Request_Body_With_Server(t *testing.T) {
1150
1150
t .Parallel ()
1151
1151
testRequest (t ,
1152
1152
func (c fiber.Ctx ) error {
1153
- return c .SendString (string (c .Request ().Body ()))
1153
+ return c .SendString (string (c .Req ().BodyRaw ()))
1154
1154
},
1155
1155
func (agent * Request ) {
1156
1156
agent .SetRawBody ([]byte ("hello" ))
@@ -1236,7 +1236,7 @@ func Test_Request_MaxRedirects(t *testing.T) {
1236
1236
app := fiber .New ()
1237
1237
1238
1238
app .Get ("/" , func (c fiber.Ctx ) error {
1239
- if c .Request ().URI ().QueryArgs ().Has ("foo" ) {
1239
+ if c .Context ().URI ().QueryArgs ().Has ("foo" ) {
1240
1240
return c .Redirect ().To ("/foo" )
1241
1241
}
1242
1242
return c .Redirect ().To ("/" )
0 commit comments