@@ 215-223 (lines=9) @@ | ||
212 | * @param string $key Header name, will be canonicalized to lowercase. |
|
213 | * @return string|null String value if set, null otherwise. |
|
214 | */ |
|
215 | public function get_header( $key ) { |
|
216 | $key = $this->canonicalize_header_name( $key ); |
|
217 | ||
218 | if ( ! isset( $this->headers[ $key ] ) ) { |
|
219 | return null; |
|
220 | } |
|
221 | ||
222 | return implode( ',', $this->headers[ $key ] ); |
|
223 | } |
|
224 | ||
225 | /** |
|
226 | * Retrieves header values from the request. |
|
@@ 234-242 (lines=9) @@ | ||
231 | * @param string $key Header name, will be canonicalized to lowercase. |
|
232 | * @return array|null List of string values if set, null otherwise. |
|
233 | */ |
|
234 | public function get_header_as_array( $key ) { |
|
235 | $key = $this->canonicalize_header_name( $key ); |
|
236 | ||
237 | if ( ! isset( $this->headers[ $key ] ) ) { |
|
238 | return null; |
|
239 | } |
|
240 | ||
241 | return $this->headers[ $key ]; |
|
242 | } |
|
243 | ||
244 | /** |
|
245 | * Sets the header on request. |