@@ -855,7 +855,7 @@ func Test_Request_Patch(t *testing.T) {
855855func Test_Request_Header_With_Server (t * testing.T ) {
856856 t .Parallel ()
857857 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 ) {
859859 if k := string (key ); k == "K1" || k == "K2" {
860860 _ , err := c .Write (key )
861861 require .NoError (t , err )
@@ -885,7 +885,7 @@ func Test_Request_UserAgent_With_Server(t *testing.T) {
885885 t .Parallel ()
886886
887887 handler := func (c fiber.Ctx ) error {
888- return c .Send (c .Request (). Header . UserAgent ( ))
888+ return c .SendString (c .Get ( fiber . HeaderUserAgent ))
889889 }
890890
891891 t .Run ("default" , func (t * testing.T ) {
@@ -923,7 +923,7 @@ func Test_Request_Cookie_With_Server(t *testing.T) {
923923func Test_Request_Referer_With_Server (t * testing.T ) {
924924 t .Parallel ()
925925 handler := func (c fiber.Ctx ) error {
926- return c .Send (c .Request (). Header . Referer ( ))
926+ return c .SendString (c .Get ( fiber . HeaderReferer ))
927927 }
928928
929929 wrapAgent := func (req * Request ) {
@@ -936,7 +936,7 @@ func Test_Request_Referer_With_Server(t *testing.T) {
936936func Test_Request_QueryString_With_Server (t * testing.T ) {
937937 t .Parallel ()
938938 handler := func (c fiber.Ctx ) error {
939- return c .Send (c .Request ().URI ().QueryString ())
939+ return c .Send (c .Context ().URI ().QueryString ())
940940 }
941941
942942 wrapAgent := func (req * Request ) {
@@ -974,8 +974,8 @@ func Test_Request_Body_With_Server(t *testing.T) {
974974 t .Parallel ()
975975 testRequest (t ,
976976 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 ()))
979979 },
980980 func (agent * Request ) {
981981 agent .SetJSON (map [string ]string {
@@ -990,8 +990,8 @@ func Test_Request_Body_With_Server(t *testing.T) {
990990 t .Parallel ()
991991 testRequest (t ,
992992 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 ()))
995995 },
996996 func (agent * Request ) {
997997 type args struct {
@@ -1009,7 +1009,7 @@ func Test_Request_Body_With_Server(t *testing.T) {
10091009 t .Parallel ()
10101010 testRequest (t ,
10111011 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 )))
10131013 return c .Send ([]byte ("foo=" + c .FormValue ("foo" ) + "&bar=" + c .FormValue ("bar" ) + "&fiber=" + c .FormValue ("fiber" )))
10141014 },
10151015 func (agent * Request ) {
@@ -1033,7 +1033,7 @@ func Test_Request_Body_With_Server(t *testing.T) {
10331033 require .NoError (t , err )
10341034 require .Equal (t , "bar" , mf .Value ["foo" ][0 ])
10351035
1036- return c .Send (c .Request ().Body ())
1036+ return c .Send (c .Req ().Body ())
10371037 })
10381038
10391039 go start ()
@@ -1125,7 +1125,7 @@ func Test_Request_Body_With_Server(t *testing.T) {
11251125 reg := regexp .MustCompile (`multipart/form-data; boundary=[\-\w]{35}` )
11261126 require .True (t , reg .MatchString (c .Get (fiber .HeaderContentType )))
11271127
1128- return c .Send (c .Request ().Body ())
1128+ return c .Send (c .Req ().BodyRaw ())
11291129 })
11301130
11311131 go start ()
@@ -1150,7 +1150,7 @@ func Test_Request_Body_With_Server(t *testing.T) {
11501150 t .Parallel ()
11511151 testRequest (t ,
11521152 func (c fiber.Ctx ) error {
1153- return c .SendString (string (c .Request ().Body ()))
1153+ return c .SendString (string (c .Req ().BodyRaw ()))
11541154 },
11551155 func (agent * Request ) {
11561156 agent .SetRawBody ([]byte ("hello" ))
@@ -1236,7 +1236,7 @@ func Test_Request_MaxRedirects(t *testing.T) {
12361236 app := fiber .New ()
12371237
12381238 app .Get ("/" , func (c fiber.Ctx ) error {
1239- if c .Request ().URI ().QueryArgs ().Has ("foo" ) {
1239+ if c .Context ().URI ().QueryArgs ().Has ("foo" ) {
12401240 return c .Redirect ().To ("/foo" )
12411241 }
12421242 return c .Redirect ().To ("/" )
0 commit comments