Skip to content

Commit 1a0860d

Browse files
authored
perf(http): use keyed request header lookup (#2158)
1 parent a6dc8a1 commit 1a0860d

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

packages/http/src/RequestHeaders.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,7 @@ public function offsetGet(mixed $offset): string
4343

4444
public function get(string $name, ?string $default = null): ?string
4545
{
46-
$header = array_find(
47-
array: $this->headers,
48-
callback: fn (mixed $_, string $header) => strcasecmp($header, $name) === 0,
49-
);
50-
51-
return $header ?? $default;
46+
return $this->headers[strtolower($name)] ?? $default;
5247
}
5348

5449
public function has(string $name): bool

0 commit comments

Comments
 (0)