| | 1316 | /** |
| | 1317 | * @ticket 47077 |
| | 1318 | */ |
| | 1319 | public function test_http_authorization_header_substitution() { |
| | 1320 | $headers = array( 'HTTP_AUTHORIZATION' => 'foo' ); |
| | 1321 | $parsed_headers = rest_get_server()->get_headers( $headers ); |
| | 1322 | |
| | 1323 | $this->assertSame( |
| | 1324 | array( 'AUTHORIZATION' => 'foo' ), |
| | 1325 | $parsed_headers |
| | 1326 | ); |
| | 1327 | } |
| | 1328 | |
| | 1329 | /** |
| | 1330 | * @ticket 47077 |
| | 1331 | */ |
| | 1332 | public function test_redirect_http_authorization_header_substitution() { |
| | 1333 | $headers = array( 'REDIRECT_HTTP_AUTHORIZATION' => 'foo' ); |
| | 1334 | $parsed_headers = rest_get_server()->get_headers( $headers ); |
| | 1335 | |
| | 1336 | $this->assertSame( |
| | 1337 | array( 'AUTHORIZATION' => 'foo' ), |
| | 1338 | $parsed_headers |
| | 1339 | ); |
| | 1340 | } |
| | 1341 | |
| | 1342 | /** |
| | 1343 | * @ticket 47077 |
| | 1344 | */ |
| | 1345 | public function test_redirect_http_authorization_with_http_authorization_header_substitution() { |
| | 1346 | $headers = array( |
| | 1347 | 'HTTP_AUTHORIZATION' => 'foo', |
| | 1348 | 'REDIRECT_HTTP_AUTHORIZATION' => 'bar', |
| | 1349 | ); |
| | 1350 | $parsed_headers = rest_get_server()->get_headers( $headers ); |
| | 1351 | |
| | 1352 | $this->assertSame( |
| | 1353 | array( 'AUTHORIZATION' => 'foo' ), |
| | 1354 | $parsed_headers |
| | 1355 | ); |
| | 1356 | } |
| | 1357 | |
| | 1358 | /** |
| | 1359 | * @ticket 47077 |
| | 1360 | */ |
| | 1361 | public function test_redirect_http_authorization_with_empty_http_authorization_header_substitution() { |
| | 1362 | $headers = array( |
| | 1363 | 'HTTP_AUTHORIZATION' => '', |
| | 1364 | 'REDIRECT_HTTP_AUTHORIZATION' => 'bar', |
| | 1365 | ); |
| | 1366 | $parsed_headers = rest_get_server()->get_headers( $headers ); |
| | 1367 | |
| | 1368 | $this->assertSame( |
| | 1369 | array( 'AUTHORIZATION' => 'bar' ), |
| | 1370 | $parsed_headers |
| | 1371 | ); |
| | 1372 | } |
| | 1373 | |