@@ -59,7 +59,7 @@ func Test_Static_Index_Default(t *testing.T) {
5959
6060 body , err = io .ReadAll (resp .Body )
6161 require .NoError (t , err )
62- require .Equal (t , "Cannot GET /not-found " , string (body ))
62+ require .Equal (t , "Not Found " , string (body ))
6363}
6464
6565// go test -run Test_Static_Index
@@ -178,7 +178,7 @@ func Test_Static_Disable_Cache(t *testing.T) {
178178
179179 body , err = io .ReadAll (resp .Body )
180180 require .NoError (t , err )
181- require .Equal (t , "Cannot GET /test.txt " , string (body ))
181+ require .Equal (t , "Not Found " , string (body ))
182182}
183183
184184func Test_Static_NotFoundHandler (t * testing.T ) {
@@ -962,13 +962,13 @@ func Test_Static_PathTraversal(t *testing.T) {
962962 body , err := io .ReadAll (resp .Body )
963963 require .NoError (t , err )
964964
965- // If we got a 404, we expect the "Cannot GET " message because that's how fiber handles NotFound by default.
965+ // If we got a 404, we expect the "Not Found " message because that's how fiber handles NotFound by default.
966966 if status == 404 {
967- require .Contains (t , string (body ), "Cannot GET " ,
968- "Blocked traversal should have a Cannot GET message for %s" , path )
967+ require .Contains (t , string (body ), "Not Found " ,
968+ "Blocked traversal should have a \" Not Found \" message for %s" , path )
969969 } else {
970970 require .Contains (t , string (body ), "Are you a hacker?" ,
971- "Blocked traversal should have a Cannot GET message for %s" , path )
971+ "Blocked traversal should have a \" Not Found \" message for %s" , path )
972972 }
973973 }
974974
@@ -1066,15 +1066,15 @@ func Test_Static_PathTraversal_WindowsOnly(t *testing.T) {
10661066 require .Containsf (t , []int {400 , 404 }, status ,
10671067 "Status code for path traversal %s should be 400 or 404, got %d" , path , status )
10681068
1069- // If it's a 404, we expect a "Cannot GET " message
1069+ // If it's a 404, we expect a "Not Found " message
10701070 if status == 404 {
10711071 respBody , err := io .ReadAll (resp .Body )
10721072 require .NoError (t , err )
1073- require .Contains (t , string (respBody ), "Cannot GET " ,
1074- "Blocked traversal should have a 'Cannot GET' message for %s" , path )
1073+ require .Contains (t , string (respBody ), "Not Found " ,
1074+ "Blocked traversal should have a \" Not Found \" message for %s" , path )
10751075 } else {
10761076 require .Contains (t , string (body ), "Are you a hacker?" ,
1077- "Blocked traversal should have a Cannot GET message for %s" , path )
1077+ "Blocked traversal should have a \" Not Found \" message for %s" , path )
10781078 }
10791079 }
10801080
0 commit comments