protected function addPolicyHeader(ResponseInterface $response)
    {
        $this->loadDefaultProfiles();

        $currentHeader = $response->getHeader($this->header);

        $initialConfig = [];
        if (count($currentHeader)) {
            $initialConfig = $this->decodeConfiguration($currentHeader[0]);
        }

        $initialDirectives = $this->encodeConfiguration($initialConfig);

        $this->mergeProfileWithConfig($initialConfig);

        $newDirectives = $this->encodeConfiguration($this->config);

        if ($newDirectives != $initialDirectives) {
            $response = $response->withHeader($this->header, $newDirectives);
        }

        return $response;
    }