mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-29 19:54:49 +00:00
Add test to ensure request url contains "?" only when explicitly specified in the url
This commit is contained in:
@@ -188,4 +188,11 @@ class CurlTest extends PHPUnit_Framework_TestCase {
|
||||
'key' => 'HTTP_ACCEPT',
|
||||
)) === 'application/json');
|
||||
}
|
||||
|
||||
public function testRequestURL() {
|
||||
$test = new Test();
|
||||
$this->assertFalse(substr($test->server('request_uri', 'POST'), -1) === '?');
|
||||
$test = new Test();
|
||||
$this->assertFalse(substr($test->server('request_uri', 'GET'), -1) === '?');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +43,10 @@ else if ($test === 'request_method') {
|
||||
echo $request_method;
|
||||
exit;
|
||||
}
|
||||
else if ($test === 'request_uri') {
|
||||
echo $_SERVER['REQUEST_URI'];
|
||||
exit;
|
||||
}
|
||||
|
||||
header('Content-Type: text/plain');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user