Commit 7f97a116 authored by Antony Le Courtes's avatar Antony Le Courtes
Browse files

Nettoyage header selon l'action

parent 01247973
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -27,9 +27,6 @@ class CurlAccess
    {
        $this->logger = $logger;
        $this->archivePath = $archivePath;
        $this->headers = [
            'User-Agent: Opera/9.80 (Windows NT 6.2; Win64; x64) Presto/2.12.388 Version/12.15','Referer: http://someaddress.tld','Content-Type: multipart/form-data',
        ];
        if(!empty($token))
        {
            $this->headers[] = 'X-API-Key: ' . $token;
@@ -59,7 +56,8 @@ class CurlAccess

    public function delete($url, array $posted):array{
        $this->logger->debug("CURL [delete] $url");

        $this->headers[] = 'User-Agent: Opera/9.80 (Windows NT 6.2; Win64; x64) Presto/2.12.388 Version/12.15';
        $this->headers[] = 'Referer: http://someaddress.tld';

        $curl = curl_init();
        curl_setopt($curl, CURLOPT_URL,$url);
@@ -112,6 +110,9 @@ class CurlAccess
    public function post( $url, $post, $documents ):array
    {
        $this->logger->debug("CURL [post] $url");
        $this->headers[] = 'User-Agent: Opera/9.80 (Windows NT 6.2; Win64; x64) Presto/2.12.388 Version/12.15';
        $this->headers[] = 'Referer: http://someaddress.tld';
        $this->headers[] = 'Content-Type: multipart/form-data';
        $posted = $post;
        foreach ($documents as $key=>$path) {
            $cfile = curl_file_create($path,'application/pdf',$key);