<commit_before><?php

class EngineBlock_Corto_Module_Service_Certificate extends EngineBlock_Corto_Module_Service_Abstract
{
    public function serve($serviceName)
    {
        $filename = $_SERVER['SERVER_NAME'] . '.pem';
        $certificates = $this->_server->getSigningCertificates();
        $publicCertContents = $certificates['public'];

        header('Content-Type: application/x-pem-file');
        header('Content-Disposition: attachment; filename="' . $filename . '"');
        header('Content-Transfer-Encoding: binary');
        header('Content-Length: ' . strlen($publicCertContents));
        header('Expires: 0');

        // check for IE only headers
        if (isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)) {
            header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
            header('Pragma: public');
        } else {
            header('Pragma: no-cache');
        }

        echo $publicCertContents;
    }
}<commit_msg>Bugfix to /proxy/certificate after introduction of new X509 classes.<commit_after><?php

class EngineBlock_Corto_Module_Service_Certificate extends EngineBlock_Corto_Module_Service_Abstract
{
    public function serve($serviceName)
    {
        $filename = $_SERVER['SERVER_NAME'] . '.pem';
        $certificates = $this->_server->getSigningCertificates();
        $publicCertContents = $certificates->getCertificate()->toPem();

        header('Content-Type: application/x-pem-file');
        header('Content-Disposition: attachment; filename="' . $filename . '"');
        header('Content-Transfer-Encoding: binary');
        header('Content-Length: ' . strlen($publicCertContents));
        header('Expires: 0');

        // check for IE only headers
        if (isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)) {
            header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
            header('Pragma: public');
        } else {
            header('Pragma: no-cache');
        }

        echo $publicCertContents;
    }
}
{'fraction_non_alphanumeric': 0.14914772727272727, 'fraction_numerical': 0.004261363636363636, 'mean_word_length': 3.1924603174603177, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5649858', 'n_tokens_mistral': 599, 'n_tokens_neox': 584, 'n_words': 104}