First Commit
This commit is contained in:
+13
@@ -0,0 +1,13 @@
|
||||
# editorconfig.org
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_style = tab
|
||||
trim_trailing_whitespace = true
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
|
||||
[*.md]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
Executable
+6
@@ -0,0 +1,6 @@
|
||||
# IntelliJ
|
||||
.idea/
|
||||
|
||||
# Composer
|
||||
vendor/
|
||||
composer.phar
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) delight.im (https://www.delight.im/)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
# Migration
|
||||
|
||||
## General
|
||||
|
||||
Update your version of this library using Composer and its `composer update` or `composer require` commands [[?]](https://github.com/delight-im/Knowledge/blob/master/Composer%20(PHP).md#how-do-i-update-libraries-or-modules-within-my-application).
|
||||
|
||||
## From `v1.x.x` to `v2.x.x`
|
||||
|
||||
* The license has been changed from the [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0) to the [MIT License](https://opensource.org/licenses/MIT).
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
# PHP-HTTP
|
||||
|
||||
Hypertext Transfer Protocol (HTTP) utilities for PHP
|
||||
|
||||
## Requirements
|
||||
|
||||
* PHP 5.3.0+
|
||||
|
||||
## Installation
|
||||
|
||||
1. Include the library via Composer [[?]](https://github.com/delight-im/Knowledge/blob/master/Composer%20(PHP).md):
|
||||
|
||||
```
|
||||
$ composer require delight-im/http
|
||||
```
|
||||
|
||||
1. Include the Composer autoloader:
|
||||
|
||||
```php
|
||||
require __DIR__ . '/vendor/autoload.php';
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### Response headers
|
||||
|
||||
* Retrieving a header (with optional value prefix)
|
||||
|
||||
```php
|
||||
$header = \Delight\Http\ResponseHeader::get('Content-Type');
|
||||
// or
|
||||
$header = \Delight\Http\ResponseHeader::get('Content-Type', 'text/');
|
||||
```
|
||||
|
||||
* Setting a header (overwriting other headers with the same name)
|
||||
|
||||
```php
|
||||
\Delight\Http\ResponseHeader::set('X-Frame-Options', 'sameorigin');
|
||||
```
|
||||
|
||||
* Adding a header (preserving other headers with the same name)
|
||||
|
||||
```php
|
||||
\Delight\Http\ResponseHeader::add('Vary', 'User-Agent');
|
||||
```
|
||||
|
||||
* Removing a header (with optional value prefix)
|
||||
|
||||
```php
|
||||
$success = \Delight\Http\ResponseHeader::remove('X-Powered-By');
|
||||
// or
|
||||
$success = \Delight\Http\ResponseHeader::remove('X-Powered-By', 'PHP');
|
||||
```
|
||||
|
||||
* Retrieving and removing a header at once (with optional value prefix)
|
||||
|
||||
```php
|
||||
$header = \Delight\Http\ResponseHeader::take('Set-Cookie');
|
||||
// or
|
||||
$header = \Delight\Http\ResponseHeader::take('Set-Cookie', 'mysession=');
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
All contributions are welcome! If you wish to contribute, please create an issue first so that your feature, problem or question can be discussed.
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "delight-im/http",
|
||||
"description": "Hypertext Transfer Protocol (HTTP) utilities for PHP",
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
},
|
||||
"type": "library",
|
||||
"keywords": [ "http", "https", "headers" ],
|
||||
"homepage": "https://github.com/delight-im/PHP-HTTP",
|
||||
"license": "MIT",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Delight\\Http\\": "src/"
|
||||
}
|
||||
}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"_readme": [
|
||||
"This file locks the dependencies of your project to a known state",
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"hash": "33b28670c4a351b72361eb5eea147fac",
|
||||
"content-hash": "a875b5a43edd7d3ea439b781aca1606f",
|
||||
"packages": [],
|
||||
"packages-dev": [],
|
||||
"aliases": [],
|
||||
"minimum-stability": "stable",
|
||||
"stability-flags": [],
|
||||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": {
|
||||
"php": ">=5.3.0"
|
||||
},
|
||||
"platform-dev": []
|
||||
}
|
||||
+165
@@ -0,0 +1,165 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* PHP-HTTP (https://github.com/delight-im/PHP-HTTP)
|
||||
* Copyright (c) delight.im (https://www.delight.im/)
|
||||
* Licensed under the MIT License (https://opensource.org/licenses/MIT)
|
||||
*/
|
||||
|
||||
namespace Delight\Http;
|
||||
|
||||
/** HTTP response headers sent by the server */
|
||||
final class ResponseHeader {
|
||||
|
||||
private function __construct() { }
|
||||
|
||||
/**
|
||||
* Returns the header with the specified name (and optional value prefix)
|
||||
*
|
||||
* @param string $name the name of the header
|
||||
* @param string $valuePrefix the optional string to match at the beginning of the header's value
|
||||
* @return string|null the header (if found) or `null`
|
||||
*/
|
||||
public static function get($name, $valuePrefix = '') {
|
||||
if (empty($name)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$nameLength = \strlen($name);
|
||||
$headers = \headers_list();
|
||||
|
||||
foreach ($headers as $header) {
|
||||
if (\strcasecmp(\substr($header, 0, $nameLength + 1), ($name . ':')) === 0) {
|
||||
$headerValue = \trim(\substr($header, $nameLength + 1), "\t ");
|
||||
|
||||
if (empty($valuePrefix) || \substr($headerValue, 0, \strlen($valuePrefix)) === $valuePrefix) {
|
||||
return $header;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of the header with the specified name (and optional value prefix)
|
||||
*
|
||||
* @param string $name the name of the header
|
||||
* @param string $valuePrefix the optional string to match at the beginning of the header's value
|
||||
* @return string|null the value of the header (if found) or `null`
|
||||
*/
|
||||
public static function getValue($name, $valuePrefix = '') {
|
||||
$header = static::get($name, $valuePrefix);
|
||||
|
||||
if (!empty($header)) {
|
||||
$nameLength = \strlen($name);
|
||||
$headerValue = \substr($header, $nameLength + 1);
|
||||
$headerValue = \trim($headerValue, "\t ");
|
||||
|
||||
return $headerValue;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the header with the specified name and value
|
||||
*
|
||||
* If another header with the same name has already been set previously, that header will be overwritten
|
||||
*
|
||||
* @param string $name the name of the header
|
||||
* @param string $value the corresponding value for the header
|
||||
*/
|
||||
public static function set($name, $value) {
|
||||
\header($name . ': ' . $value, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the header with the specified name and value
|
||||
*
|
||||
* If another header with the same name has already been set previously, both headers (or header values) will be sent
|
||||
*
|
||||
* @param string $name the name of the header
|
||||
* @param string $value the corresponding value for the header
|
||||
*/
|
||||
public static function add($name, $value) {
|
||||
\header($name . ': ' . $value, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the header with the specified name (and optional value prefix)
|
||||
*
|
||||
* @param string $name the name of the header
|
||||
* @param string $valuePrefix the optional string to match at the beginning of the header's value
|
||||
* @return bool whether a header, as specified, has been found and removed
|
||||
*/
|
||||
public static function remove($name, $valuePrefix = '') {
|
||||
return static::take($name, $valuePrefix) !== null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns and removes the header with the specified name (and optional value prefix)
|
||||
*
|
||||
* @param string $name the name of the header
|
||||
* @param string $valuePrefix the optional string to match at the beginning of the header's value
|
||||
* @return string|null the header (if found) or `null`
|
||||
*/
|
||||
public static function take($name, $valuePrefix = '') {
|
||||
if (empty($name)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$nameLength = \strlen($name);
|
||||
$headers = \headers_list();
|
||||
|
||||
$first = null;
|
||||
$homonyms = [];
|
||||
|
||||
foreach ($headers as $header) {
|
||||
if (\strcasecmp(\substr($header, 0, $nameLength + 1), ($name . ':')) === 0) {
|
||||
$headerValue = \trim(\substr($header, $nameLength + 1), "\t ");
|
||||
|
||||
if ((empty($valuePrefix) || \substr($headerValue, 0, \strlen($valuePrefix)) === $valuePrefix) && $first === null) {
|
||||
$first = $header;
|
||||
}
|
||||
else {
|
||||
$homonyms[] = $header;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($first !== null) {
|
||||
\header_remove($name);
|
||||
|
||||
foreach ($homonyms as $homonym) {
|
||||
\header($homonym, false);
|
||||
}
|
||||
}
|
||||
|
||||
return $first;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of and removes the header with the specified name (and optional value prefix)
|
||||
*
|
||||
* @param string $name the name of the header
|
||||
* @param string $valuePrefix the optional string to match at the beginning of the header's value
|
||||
* @return string|null the value of the header (if found) or `null`
|
||||
*/
|
||||
public static function takeValue($name, $valuePrefix = '') {
|
||||
$header = static::take($name, $valuePrefix);
|
||||
|
||||
if (!empty($header)) {
|
||||
$nameLength = \strlen($name);
|
||||
$headerValue = \substr($header, $nameLength + 1);
|
||||
$headerValue = \trim($headerValue, "\t ");
|
||||
|
||||
return $headerValue;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+231
@@ -0,0 +1,231 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* PHP-HTTP (https://github.com/delight-im/PHP-HTTP)
|
||||
* Copyright (c) delight.im (https://www.delight.im/)
|
||||
* Licensed under the MIT License (https://opensource.org/licenses/MIT)
|
||||
*/
|
||||
|
||||
// enable error reporting
|
||||
\error_reporting(\E_ALL);
|
||||
\ini_set('display_errors', 'stdout');
|
||||
|
||||
\header('Content-Type: text/plain; charset=utf-8');
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
function fail($lineNumber) {
|
||||
exit('Error on line ' . $lineNumber);
|
||||
}
|
||||
|
||||
// start output buffering
|
||||
\ob_start();
|
||||
|
||||
\Delight\Http\ResponseHeader::set('X-Dd75c0cffe64df82', '535ab646c2f8451a');
|
||||
(\Delight\Http\ResponseHeader::get('X-Dd75c0cffe64df82') === 'X-Dd75c0cffe64df82: 535ab646c2f8451a') or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('Content-Type') === 'Content-Type: text/plain; charset=utf-8') or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('Content-Type', 'text/p') === 'Content-Type: text/plain; charset=utf-8') or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('Content-Type', 'text/h') === null) or \fail(__LINE__);
|
||||
|
||||
(\Delight\Http\ResponseHeader::remove('X-Dd75c0cffe64df82', 'z') === false) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-Dd75c0cffe64df82') === 'X-Dd75c0cffe64df82: 535ab646c2f8451a') or \fail(__LINE__);
|
||||
|
||||
(\Delight\Http\ResponseHeader::remove('X-Dd75c0cffe64df82', \substr('535ab646c2f8451a', 0, 4)) === true) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-Dd75c0cffe64df82') === null) or \fail(__LINE__);
|
||||
|
||||
\Delight\Http\ResponseHeader::set('X-Ff4d986c9f5de0b9', '846157f7e880442a');
|
||||
(\Delight\Http\ResponseHeader::get('X-Ff4d986c9f5de0b9') === 'X-Ff4d986c9f5de0b9: 846157f7e880442a') or \fail(__LINE__);
|
||||
|
||||
(\Delight\Http\ResponseHeader::take('X-Ff4d986c9f5de0b9') === 'X-Ff4d986c9f5de0b9: 846157f7e880442a') or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-Ff4d986c9f5de0b9') === null) or \fail(__LINE__);
|
||||
|
||||
\Delight\Http\ResponseHeader::add('X-C08a89582f64bb96', 'caebdac147484892');
|
||||
\Delight\Http\ResponseHeader::add('X-C08a89582f64bb96', 'b0420816e9ec7b71');
|
||||
\Delight\Http\ResponseHeader::add('X-C08a89582f64bb96', '96af309d3d39426a');
|
||||
(\Delight\Http\ResponseHeader::get('X-C08a89582f64bb96') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::take('X-C08a89582f64bb96') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::take('X-C08a89582f64bb96') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::take('X-C08a89582f64bb96') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::take('X-C08a89582f64bb96') === null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-C08a89582f64bb96') === null) or \fail(__LINE__);
|
||||
|
||||
\Delight\Http\ResponseHeader::add('X-Ed429f99cf4df084', '190d964f15db158f');
|
||||
\Delight\Http\ResponseHeader::add('X-Ed429f99cf4df084', '290d964f15db158f');
|
||||
\Delight\Http\ResponseHeader::add('X-Ed429f99cf4df084', '390d964f15db158f');
|
||||
(\Delight\Http\ResponseHeader::get('X-Ed429f99cf4df084') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::take('X-Ed429f99cf4df084', '2') === 'X-Ed429f99cf4df084: 290d964f15db158f') or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::take('X-Ed429f99cf4df084', '2') === null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::take('X-Ed429f99cf4df084', '3') === 'X-Ed429f99cf4df084: 390d964f15db158f') or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::take('X-Ed429f99cf4df084', '3') === null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::take('X-Ed429f99cf4df084', '1') === 'X-Ed429f99cf4df084: 190d964f15db158f') or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::take('X-Ed429f99cf4df084', '1') === null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-Ed429f99cf4df084') === null) or \fail(__LINE__);
|
||||
|
||||
\Delight\Http\ResponseHeader::set('X-Fb61d1020e187480', 'c2d7a80cda4145cd');
|
||||
\Delight\Http\ResponseHeader::set('X-B26cb22b1b06f99a', 'b755c55b79f69b3c');
|
||||
\Delight\Http\ResponseHeader::add('X-Aeef46c385398098', '1fe95dd27b13a48a');
|
||||
\Delight\Http\ResponseHeader::add('X-Aeef46c385398098', '2fe95dd27b13a48a');
|
||||
\Delight\Http\ResponseHeader::add('X-Aeef46c385398098', '3fe95dd27b13a48a');
|
||||
(\Delight\Http\ResponseHeader::get('X-Fb61d1020e187480') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-B26cb22b1b06f99a') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-Aeef46c385398098') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-Aeef46c385398098', '2') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::remove('X-Aeef46c385398098', '2') === true) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-Fb61d1020e187480') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-B26cb22b1b06f99a') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-Aeef46c385398098') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-Aeef46c385398098', '2') === null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::remove('X-B26cb22b1b06f99a') === true) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-Fb61d1020e187480') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-B26cb22b1b06f99a') === null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-Aeef46c385398098') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-Aeef46c385398098', '2') === null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::remove('X-Fb61d1020e187480') === true) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-Fb61d1020e187480') === null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-B26cb22b1b06f99a') === null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-Aeef46c385398098') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-Aeef46c385398098', '2') === null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::remove('X-Aeef46c385398098') === true) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-Fb61d1020e187480') === null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-B26cb22b1b06f99a') === null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-Aeef46c385398098') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-Aeef46c385398098', '2') === null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::remove('X-Aeef46c385398098') === true) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-Fb61d1020e187480') === null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-B26cb22b1b06f99a') === null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-Aeef46c385398098') === null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-Aeef46c385398098', '2') === null) or \fail(__LINE__);
|
||||
|
||||
\Delight\Http\ResponseHeader::set('X-B0b8ed49addae9a7', '817cD2c2cb94bbdd');
|
||||
(\Delight\Http\ResponseHeader::get('X-B0b8ed49addae9a7') === 'X-B0b8ed49addae9a7: 817cD2c2cb94bbdd') or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-B0B8ED49ADDAE9A7') === 'X-B0b8ed49addae9a7: 817cD2c2cb94bbdd') or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('x-b0b8ed49addae9a7') === 'X-B0b8ed49addae9a7: 817cD2c2cb94bbdd') or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-B0b8ed49addae9a7', '817cD') === 'X-B0b8ed49addae9a7: 817cD2c2cb94bbdd') or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-B0b8ed49addae9a7', '817CD') === null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-B0b8ed49addae9a7', '817cd') === null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-B0b8ed49adda') === null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-B0b8ed49addae9a7') === 'X-B0b8ed49addae9a7: 817cD2c2cb94bbdd') or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::remove('X-B0b8ed49addae9a7') === true) or \fail(__LINE__);
|
||||
|
||||
\Delight\Http\ResponseHeader::set('X-E6f1dda6cd696709', 'cD571abab1cc4b1b');
|
||||
(\Delight\Http\ResponseHeader::remove('X-E6f1dda6cd696709') === true) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-E6f1dda6cd696709') === null) or \fail(__LINE__);
|
||||
\Delight\Http\ResponseHeader::set('X-E6f1dda6cd696709', 'cD571abab1cc4b1b');
|
||||
(\Delight\Http\ResponseHeader::remove('X-E6F1DDA6CD696709') === true) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-E6f1dda6cd696709') === null) or \fail(__LINE__);
|
||||
\Delight\Http\ResponseHeader::set('X-E6f1dda6cd696709', 'cD571abab1cc4b1b');
|
||||
(\Delight\Http\ResponseHeader::remove('x-e6f1dda6cd696709') === true) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-E6f1dda6cd696709') === null) or \fail(__LINE__);
|
||||
\Delight\Http\ResponseHeader::set('X-E6f1dda6cd696709', 'cD571abab1cc4b1b');
|
||||
(\Delight\Http\ResponseHeader::remove('X-E6f1dda6cd696709', 'cD57') === true) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-E6f1dda6cd696709') === null) or \fail(__LINE__);
|
||||
\Delight\Http\ResponseHeader::set('X-E6f1dda6cd696709', 'cD571abab1cc4b1b');
|
||||
(\Delight\Http\ResponseHeader::remove('X-E6f1dda6cd696709', 'CD57') === false) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-E6f1dda6cd696709') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::remove('X-E6f1dda6cd696709') === true) or \fail(__LINE__);
|
||||
\Delight\Http\ResponseHeader::set('X-E6f1dda6cd696709', 'cD571abab1cc4b1b');
|
||||
(\Delight\Http\ResponseHeader::remove('X-E6f1dda6cd696709', 'cd57') === false) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-E6f1dda6cd696709') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::remove('X-E6f1dda6cd696709') === true) or \fail(__LINE__);
|
||||
\Delight\Http\ResponseHeader::set('X-E6f1dda6cd696709', 'cD571abab1cc4b1b');
|
||||
(\Delight\Http\ResponseHeader::remove('X-E6f1dda6cd69') === false) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-E6f1dda6cd696709') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::remove('X-E6f1dda6cd696709') === true) or \fail(__LINE__);
|
||||
\Delight\Http\ResponseHeader::set('X-E6f1dda6cd696709', 'cD571abab1cc4b1b');
|
||||
(\Delight\Http\ResponseHeader::remove('X-E6f1dda6cd696709') === true) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-E6f1dda6cd696709') === null) or \fail(__LINE__);
|
||||
|
||||
\Delight\Http\ResponseHeader::set('X-E6f1dda6cd696709', 'cD571abab1cc4b1b');
|
||||
(\Delight\Http\ResponseHeader::take('X-E6f1dda6cd696709') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-E6f1dda6cd696709') === null) or \fail(__LINE__);
|
||||
\Delight\Http\ResponseHeader::set('X-E6f1dda6cd696709', 'cD571abab1cc4b1b');
|
||||
(\Delight\Http\ResponseHeader::take('X-E6F1DDA6CD696709') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-E6f1dda6cd696709') === null) or \fail(__LINE__);
|
||||
\Delight\Http\ResponseHeader::set('X-E6f1dda6cd696709', 'cD571abab1cc4b1b');
|
||||
(\Delight\Http\ResponseHeader::take('x-e6f1dda6cd696709') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-E6f1dda6cd696709') === null) or \fail(__LINE__);
|
||||
\Delight\Http\ResponseHeader::set('X-E6f1dda6cd696709', 'cD571abab1cc4b1b');
|
||||
(\Delight\Http\ResponseHeader::take('X-E6f1dda6cd696709', 'cD57') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-E6f1dda6cd696709') === null) or \fail(__LINE__);
|
||||
\Delight\Http\ResponseHeader::set('X-E6f1dda6cd696709', 'cD571abab1cc4b1b');
|
||||
(\Delight\Http\ResponseHeader::take('X-E6f1dda6cd696709', 'CD57') === null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-E6f1dda6cd696709') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::remove('X-E6f1dda6cd696709') === true) or \fail(__LINE__);
|
||||
\Delight\Http\ResponseHeader::set('X-E6f1dda6cd696709', 'cD571abab1cc4b1b');
|
||||
(\Delight\Http\ResponseHeader::take('X-E6f1dda6cd696709', 'cd57') === null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-E6f1dda6cd696709') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::remove('X-E6f1dda6cd696709') === true) or \fail(__LINE__);
|
||||
\Delight\Http\ResponseHeader::set('X-E6f1dda6cd696709', 'cD571abab1cc4b1b');
|
||||
(\Delight\Http\ResponseHeader::take('X-E6f1dda6cd69') === null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-E6f1dda6cd696709') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::remove('X-E6f1dda6cd696709') === true) or \fail(__LINE__);
|
||||
\Delight\Http\ResponseHeader::set('X-E6f1dda6cd696709', 'cD571abab1cc4b1b');
|
||||
(\Delight\Http\ResponseHeader::take('X-E6f1dda6cd696709') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-E6f1dda6cd696709') === null) or \fail(__LINE__);
|
||||
|
||||
\header('X-Dbf97c884f247135:8c7039d7e753d34d');
|
||||
(\Delight\Http\ResponseHeader::get('X-Dbf97c884f247135', '8c') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::remove('X-Dbf97c884f247135') === true) or \fail(__LINE__);
|
||||
\header('X-Dbf97c884f247135: 8c7039d7e753d34d');
|
||||
(\Delight\Http\ResponseHeader::get('X-Dbf97c884f247135', '8c') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::remove('X-Dbf97c884f247135') === true) or \fail(__LINE__);
|
||||
\header('X-Dbf97c884f247135: 8c7039d7e753d34d');
|
||||
(\Delight\Http\ResponseHeader::get('X-Dbf97c884f247135', '8c') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::remove('X-Dbf97c884f247135') === true) or \fail(__LINE__);
|
||||
\header('X-Dbf97c884f247135: 8c7039d7e753d34d');
|
||||
(\Delight\Http\ResponseHeader::get('X-Dbf97c884f247135', '8c') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::remove('X-Dbf97c884f247135') === true) or \fail(__LINE__);
|
||||
\header('X-Dbf97c884f247135: 8c7039d7e753d34d');
|
||||
(\Delight\Http\ResponseHeader::get('X-Dbf97c884f247135', '8c') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::remove('X-Dbf97c884f247135') === true) or \fail(__LINE__);
|
||||
\header('X-Dbf97c884f247135: 8c7039d7e753d34d');
|
||||
(\Delight\Http\ResponseHeader::get('X-Dbf97c884f247135', '8c') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::remove('X-Dbf97c884f247135') === true) or \fail(__LINE__);
|
||||
|
||||
\header('X-Bdd6ef28f9347582:975181c1666babcf');
|
||||
(\Delight\Http\ResponseHeader::remove('X-Bdd6ef28f9347582', '975') === true) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-Bdd6ef28f9347582') === null) or \fail(__LINE__);
|
||||
\header('X-Bdd6ef28f9347582: 975181c1666babcf');
|
||||
(\Delight\Http\ResponseHeader::remove('X-Bdd6ef28f9347582', '975') === true) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-Bdd6ef28f9347582') === null) or \fail(__LINE__);
|
||||
\header('X-Bdd6ef28f9347582: 975181c1666babcf');
|
||||
(\Delight\Http\ResponseHeader::remove('X-Bdd6ef28f9347582', '975') === true) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-Bdd6ef28f9347582') === null) or \fail(__LINE__);
|
||||
\header('X-Bdd6ef28f9347582: 975181c1666babcf');
|
||||
(\Delight\Http\ResponseHeader::remove('X-Bdd6ef28f9347582', '975') === true) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-Bdd6ef28f9347582') === null) or \fail(__LINE__);
|
||||
\header('X-Bdd6ef28f9347582: 975181c1666babcf');
|
||||
(\Delight\Http\ResponseHeader::remove('X-Bdd6ef28f9347582', '975') === true) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-Bdd6ef28f9347582') === null) or \fail(__LINE__);
|
||||
\header('X-Bdd6ef28f9347582: 975181c1666babcf');
|
||||
(\Delight\Http\ResponseHeader::remove('X-Bdd6ef28f9347582', '975') === true) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-Bdd6ef28f9347582') === null) or \fail(__LINE__);
|
||||
|
||||
\header('X-Ca7e51a515534d0d:422b93bf8b1b45a7');
|
||||
(\Delight\Http\ResponseHeader::take('X-Ca7e51a515534d0d', '42') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-Ca7e51a515534d0d') === null) or \fail(__LINE__);
|
||||
\header('X-Ca7e51a515534d0d: 422b93bf8b1b45a7');
|
||||
(\Delight\Http\ResponseHeader::take('X-Ca7e51a515534d0d', '42') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-Ca7e51a515534d0d') === null) or \fail(__LINE__);
|
||||
\header('X-Ca7e51a515534d0d: 422b93bf8b1b45a7');
|
||||
(\Delight\Http\ResponseHeader::take('X-Ca7e51a515534d0d', '42') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-Ca7e51a515534d0d') === null) or \fail(__LINE__);
|
||||
\header('X-Ca7e51a515534d0d: 422b93bf8b1b45a7');
|
||||
(\Delight\Http\ResponseHeader::take('X-Ca7e51a515534d0d', '42') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-Ca7e51a515534d0d') === null) or \fail(__LINE__);
|
||||
\header('X-Ca7e51a515534d0d: 422b93bf8b1b45a7');
|
||||
(\Delight\Http\ResponseHeader::take('X-Ca7e51a515534d0d', '42') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-Ca7e51a515534d0d') === null) or \fail(__LINE__);
|
||||
\header('X-Ca7e51a515534d0d: 422b93bf8b1b45a7');
|
||||
(\Delight\Http\ResponseHeader::take('X-Ca7e51a515534d0d', '42') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-Ca7e51a515534d0d') === null) or \fail(__LINE__);
|
||||
|
||||
\header('X-Cfc0bcd8696f4899: 7a31e8a76126477c ');
|
||||
(\Delight\Http\ResponseHeader::get('X-Cfc0bcd8696f4899') !== null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::getValue('X-Cfc0bcd8696f4899') === '7a31e8a76126477c') or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::getValue('X-Cfc0bcd8696f4899', '7a31e') === '7a31e8a76126477c') or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::takeValue('X-Cfc0bcd8696f4899', '7a31e') === '7a31e8a76126477c') or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::getValue('X-Cfc0bcd8696f4899') === null) or \fail(__LINE__);
|
||||
(\Delight\Http\ResponseHeader::get('X-Cfc0bcd8696f4899') === null) or \fail(__LINE__);
|
||||
|
||||
echo 'ALL TESTS PASSED' . "\n";
|
||||
Reference in New Issue
Block a user