src/Response.php
public static function globalHeaders($name = null, $value = null, $replace = true) {
        if (self::$globalHeaders === null) {
            self::$globalHeaders = [
                'P3P' => 'CP="CAO PSA OUR"'
            ];
        }

        if ($name === null) {
            return self::$globalHeaders;
        }

        $headers = static::splitHeaders($name, $value);

        if (is_string($headers)) {
            return val($headers, self::$globalHeaders);
        }

        foreach ($headers as $name => $value) {
            if ($replace || !isset(self::$globalHeaders[$name])) {
                self::$globalHeaders[$name] = $value;
            } else {
                self::$globalHeaders[$name] = array_merge((array)self::$globalHeaders, [$value]);
            }
        }
        return null;
    }
public static function globalHeaders($name = null, $value = null, $replace = true) {
        if (self::$globalHeaders === null) {
            self::$globalHeaders = [
                'P3P' => 'CP="CAO PSA OUR"'
            ];
        }

        if ($name === null) {
            return self::$globalHeaders;
        }

        $headers = static::splitHeaders($name, $value);

        if (is_string($headers)) {
            return val($headers, self::$globalHeaders);
        }

        foreach ($headers as $name => $value) {
            if ($replace || !isset(self::$globalHeaders[$name])) {
                self::$globalHeaders[$name] = $value;
            } else {
                self::$globalHeaders[$name] = array_merge((array)self::$globalHeaders, [$value]);
            }
        }
        return null;
    }
Gets or sets global headers.

The global headers exist to allow code to queue up headers before the response has been constructed.

@param string|array|null $name The name of the header or an array of headers.
@param string|null $value A new value for the header or null to get the current header.
@param bool $replace Whether or not to replace the current header or append.
@return string|array Returns one of the following:
- string|array: Returns the current value of the header at {@link $name}.
- array: Returns the entire global headers array when {@link $name} is not passed.
- null: Returns `null` when setting a global header.