!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/uploads/script/vendor/rmccue/requests/tests/   drwxr-xr-x
Free 13.39 GB of 57.97 GB (23.11%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     ChunkedEncoding.php (2.97 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

class RequestsTest_ChunkedDecoding extends PHPUnit_Framework_TestCase {
    public static function 
chunkedProvider() {
        return array(
            array(
                
"25\r\nThis is the data in the first chunk\r\n\r\n1A\r\nand this is the second one\r\n0\r\n",
                
"This is the data in the first chunk\r\nand this is the second one"
            
),
            array(
                
"02\r\nab\r\n04\r\nra\nc\r\n06\r\nadabra\r\n0\r\nnothing\n",
                
"abra\ncadabra"
            
),
            array(
                
"02\r\nab\r\n04\r\nra\nc\r\n06\r\nadabra\r\n0c\r\n\nall we got\n",
                
"abra\ncadabra\nall we got\n"
            
),
            array(
                
"02;foo=bar;hello=world\r\nab\r\n04;foo=baz\r\nra\nc\r\n06;justfoo\r\nadabra\r\n0c\r\n\nall we got\n",
                
"abra\ncadabra\nall we got\n"
            
),
            array(
                
"02;foo=\"quoted value\"\r\nab\r\n04\r\nra\nc\r\n06\r\nadabra\r\n0c\r\n\nall we got\n",
                
"abra\ncadabra\nall we got\n"
            
),
            array(
                
"02;foo-bar=baz\r\nab\r\n04\r\nra\nc\r\n06\r\nadabra\r\n0c\r\n\nall we got\n",
                
"abra\ncadabra\nall we got\n"
            
),
        );
    }

    
/**
     * @dataProvider chunkedProvider
     */
    
public function testChunked($body$expected){
        
$transport = new MockTransport();
        
$transport->body $body;
        
$transport->chunked true;

        
$options = array(
            
'transport' => $transport
        
);
        
$response Requests::get('http://example.com/', array(), $options);

        
$this->assertEquals($expected$response->body);
    }

    public static function 
notChunkedProvider() {
        return array(
            
'invalid chunk size' => array( 'Hello! This is a non-chunked response!' ),
            
'invalid chunk extension' => array( '1BNot chunked\r\nLooks chunked but it is not\r\n' ),
            
'unquoted chunk-ext-val with space' => array( "02;foo=unquoted with space\r\nab\r\n04\r\nra\nc\r\n06\r\nadabra\r\n0c\r\n\nall we got\n" ),
            
'unquoted chunk-ext-val with forbidden character' => array( "02;foo={unquoted}\r\nab\r\n04\r\nra\nc\r\n06\r\nadabra\r\n0c\r\n\nall we got\n" ),
            
'invalid chunk-ext-name' => array( "02;{foo}=bar\r\nab\r\n04\r\nra\nc\r\n06\r\nadabra\r\n0c\r\n\nall we got\n" ),
            
'incomplete quote for chunk-ext-value' => array( "02;foo=\"no end quote\r\nab\r\n04\r\nra\nc\r\n06\r\nadabra\r\n0c\r\n\nall we got\n" ),
        );
    }

    
/**
     * Response says it's chunked, but actually isn't
     * @dataProvider notChunkedProvider
     */
    
public function testNotActuallyChunked($body) {
        
$transport = new MockTransport();
        
$transport->body $body;
        
$transport->chunked true;

        
$options = array(
            
'transport' => $transport
        
);
        
$response Requests::get('http://example.com/', array(), $options);

        
$this->assertEquals($transport->body$response->body);
    }


    
/**
     * Response says it's chunked and starts looking like it is, but turns out
     * that they're lying to us
     */
    
public function testMixedChunkiness() {
        
$transport = new MockTransport();
        
$transport->body "02\r\nab\r\nNot actually chunked!";
        
$transport->chunked true;

        
$options = array(
            
'transport' => $transport
        
);
        
$response Requests::get('http://example.com/', array(), $options);
        
$this->assertEquals($transport->body$response->body);
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0113 ]--