Download src/php/php-src/sapi/cgi/tests/apache_response_headers.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 879 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/sapi/cgi/tests/apache_response_headers.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/sapi/cgi/tests/apache_response_headers.phpt
-
curl -L -o apache_response_headers.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/sapi/cgi/tests/apache_response_headers.phpt
879 Bytes
| --TEST-- | |
| apache_response_headers() | |
| --SKIPIF-- | |
| include "skipif.inc"; | |
| --FILE-- | |
| include "include.inc"; | |
| $php = get_cgi_path(); | |
| reset_env_vars(); | |
| $test_file = __DIR__ . DIRECTORY_SEPARATOR ."apache_response_headers.test.php"; | |
| $code = '<?php'; | |
| $code .= ' | |
| header( "X-Robots-Tag : noindex,nofollow,noarchive" ); | |
| header( "Content-type: text/html; charset=UTF-8" ); | |
| header( "Bad-header" ); | |
| header( " : " ); | |
| header( ":" ); | |
| flush(); | |
| var_dump( apache_response_headers() ); | |
| ?> | |
| '; | |
| file_put_contents( $test_file, $code ); | |
| passthru( "$php -n -q " . escapeshellarg( $test_file ) ); | |
| --CLEAN-- | |
| @unlink( __DIR__ . DIRECTORY_SEPARATOR ."apache_response_headers.test.php" ); | |
| --EXPECTF-- | |
| array(3) { | |
| ["X-Powered-By"]=> | |
| string(%d) "PHP/%s" | |
| ["X-Robots-Tag"]=> | |
| string(26) "noindex,nofollow,noarchive" | |
| ["Content-type"]=> | |
| string(24) "text/html; charset=UTF-8" | |
| } | |