Skip to content

Commit

Permalink
Add test case for HTTP_CF_CONNECTING_IP
Browse files Browse the repository at this point in the history
  • Loading branch information
distantnative committed May 11, 2024
1 parent 75f9777 commit c336f17
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/Api/UploadTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,19 @@ public function testChunkSize()
Upload::chunkSize()
);

// with CloudFlare
ini_set('upload_max_filesize', '200M');
ini_set('post_max_size', '200M');
$_SERVER['HTTP_CF_CONNECTING_IP'] = '1.1.1.1';

$this->assertSame(
(int)floor(100 * 1024 * 1024 * 0.95),
Upload::chunkSize()
);

ini_restore('upload_max_filesize');
ini_restore('post_max_size');
unset($_SERVER['HTTP_CF_CONNECTING_IP']);
}

/**
Expand Down

0 comments on commit c336f17

Please sign in to comment.