This repository was archived by the owner on Jun 1, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 1414use function Facebook\AutoloadMap\Generated\is_dev ;
1515
1616abstract class BaseRouter <+TResponder > {
17- public function __construct (
18- private BaseRouterOptions $options = shape (' use_get_responder_for_head' => true )
19- ) {}
17+ private bool $useGetResponderForHead ;
18+
19+ public function __construct (?BaseRouterOptions $options = null ) {
20+ $this -> useGetResponderForHead =
21+ Shapes :: idx($options , ' use_get_responder_for_head' , true );
22+ }
2023
2124 abstract protected function getRoutes (
2225 ): KeyedContainer <HttpMethod , KeyedContainer <string , TResponder >>;
@@ -37,7 +40,9 @@ final public function routeMethodAndPath(
3740 }
3841
3942 if (
40- $this -> options [' use_get_responder_for_head' ] && $method === HttpMethod :: HEAD && $allowed === keyset [HttpMethod :: GET ]
43+ $this -> useGetResponderForHead &&
44+ $method === HttpMethod :: HEAD &&
45+ $allowed === keyset [HttpMethod :: GET ]
4146 ) {
4247 list ($responder , $data ) = $resolver -> resolve(HttpMethod :: GET , $path );
4348 $data = Dict \map ($data , \urldecode <> );
Original file line number Diff line number Diff line change 1212namespace Facebook\HackRouter ;
1313
1414type BaseRouterOptions = shape(
15- ' use_get_responder_for_head' => bool ,
15+ ? ' use_get_responder_for_head' => bool ,
1616) ;
You can’t perform that action at this time.
0 commit comments