| @@ -344,8 +344,18 @@ | ||
| 344 | 344 | if ( ! empty( $query_params[ SHORT_NAME ] ) ) { |
| 345 | 345 | return true; |
| 346 | 346 | } |
| 347 | 347 | |
| 348 | + // The client's discovery probe of the REST index. When a host strips the | |
| 349 | + // front page's `Link` header, `use-url-discovery.ts` falls back to a HEAD | |
| 350 | + // of `/wp-json/`, sent as `?_method=head` with no marker (HEAD carries no | |
| 351 | + // `X-WCPOS` so it needs no preflight). The front-end twin lives in | |
| 352 | + // `Init::send_headers()`; before 1.10.0 every REST response was stamped, | |
| 353 | + // so the probe never needed claiming (roadmap#383). | |
| 354 | + if ( '/' === $request->get_route() && isset( $query_params['_method'] ) && 'head' === strtolower( (string) $query_params['_method'] ) ) { | |
| 355 | + return true; | |
| 356 | + } | |
| 357 | + | |
| 348 | 358 | return 'OPTIONS' === $request->get_method() && self::preflight_announces_wcpos( $request ); |
| 349 | 359 | } |
| 350 | 360 | |
| 351 | 361 | /** |