File tree Expand file tree Collapse file tree 2 files changed +0
-19
lines changed Expand file tree Collapse file tree 2 files changed +0
-19
lines changed Original file line number Diff line number Diff line change @@ -40,13 +40,6 @@ pub async fn new(mut req: ConduitRequest) -> AppResult<Json<Value>> {
40
40
api_token : NewApiToken ,
41
41
}
42
42
43
- let max_size = 2000 ;
44
- let length = req. content_length ( ) ;
45
-
46
- if length > max_size {
47
- return Err ( bad_request ( & format ! ( "max content length is: {max_size}" ) ) ) ;
48
- }
49
-
50
43
let new: NewApiTokenRequest = json:: from_reader ( req. body_mut ( ) )
51
44
. map_err ( |e| bad_request ( & format ! ( "invalid new token request: {e:?}" ) ) ) ?;
52
45
Original file line number Diff line number Diff line change @@ -41,18 +41,6 @@ fn create_token_no_name() {
41
41
) ;
42
42
}
43
43
44
- #[ test]
45
- fn create_token_long_body ( ) {
46
- let ( _, _, user) = TestApp :: init ( ) . with_user ( ) ;
47
- let too_big = & [ 5 ; 5192 ] ; // Send a request with a 5kB body of 5's
48
- let response = user. put :: < ( ) > ( "/api/v1/me/tokens" , too_big) ;
49
- assert_eq ! ( response. status( ) , StatusCode :: BAD_REQUEST ) ;
50
- assert_eq ! (
51
- response. into_json( ) ,
52
- json!( { "errors" : [ { "detail" : "max content length is: 2000" } ] } )
53
- ) ;
54
- }
55
-
56
44
#[ test]
57
45
fn create_token_exceeded_tokens_per_user ( ) {
58
46
let ( app, _, user) = TestApp :: init ( ) . with_user ( ) ;
You can’t perform that action at this time.
0 commit comments