Changeset 56096
- Timestamp:
- 06/28/2023 05:37:52 PM (13 months ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/class-wp-rest-server.php
r56031 r56096 322 322 */ 323 323 $this->send_header( 'X-Content-Type-Options', 'nosniff' ); 324 $expose_headers = array( 'X-WP-Total', 'X-WP-TotalPages', 'Link' );325 326 /**327 * Filters the list of response headers that are exposed to REST API CORS requests.328 *329 * @since 5.5.0330 *331 * @param string[] $expose_headers The list of response headers to expose.332 */333 $expose_headers = apply_filters( 'rest_exposed_cors_headers', $expose_headers );334 335 $this->send_header( 'Access-Control-Expose-Headers', implode( ', ', $expose_headers ) );336 337 $allow_headers = array(338 'Authorization',339 'X-WP-Nonce',340 'Content-Disposition',341 'Content-MD5',342 'Content-Type',343 );344 345 /**346 * Filters the list of request headers that are allowed for REST API CORS requests.347 *348 * The allowed headers are passed to the browser to specify which349 * headers can be passed to the REST API. By default, we allow the350 * Content-* headers needed to upload files to the media endpoints.351 * As well as the Authorization and Nonce headers for allowing authentication.352 *353 * @since 5.5.0354 *355 * @param string[] $allow_headers The list of request headers to allow.356 */357 $allow_headers = apply_filters( 'rest_allowed_cors_headers', $allow_headers );358 359 $this->send_header( 'Access-Control-Allow-Headers', implode( ', ', $allow_headers ) );360 324 361 325 /** … … 436 400 $request->set_method( $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'] ); 437 401 } 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 438 441 439 442 $result = $this->check_authentication(); -
trunk/tests/phpunit/tests/rest-api/rest-server.php
r55822 r56096 2201 2201 } 2202 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2203 2233 public function _validate_as_integer_123( $value, $request, $key ) { 2204 2234 if ( ! is_int( $value ) ) {
Note: See TracChangeset
for help on using the changeset viewer.