You are here

private function MessageTrait::trimHeaderValues in Lockr 7.3

Trims whitespace from the header values.

Spaces and tabs ought to be excluded by parsers when extracting the field value from a header field.

header-field = field-name ":" OWS field-value OWS OWS = *( SP / HTAB )

Parameters

string[] $values Header values:

Return value

string[] Trimmed header values

See also

https://tools.ietf.org/html/rfc7230#section-3.2.4

3 calls to MessageTrait::trimHeaderValues()
MessageTrait::setHeaders in vendor/guzzlehttp/psr7/src/MessageTrait.php
MessageTrait::withAddedHeader in vendor/guzzlehttp/psr7/src/MessageTrait.php
MessageTrait::withHeader in vendor/guzzlehttp/psr7/src/MessageTrait.php

File

vendor/guzzlehttp/psr7/src/MessageTrait.php, line 177

Class

MessageTrait
Trait implementing functionality common to requests and responses.

Namespace

GuzzleHttp\Psr7

Code

private function trimHeaderValues(array $values) {
  return array_map(function ($value) {
    return trim($value, " \t");
  }, $values);
}