Code Duplication    Length = 3-3 lines in 3 locations

htdocs/class/snoopy.php 3 locations

@@ 762-764 (lines=3) @@
759
        }
760
        if (!empty($body))
761
            $headers .= "Content-length: " . strlen($body) . "\r\n";
762
        if (!empty($this->user) || !empty($this->pass))
763
            $headers .= "Authorization: Basic " . base64_encode($this->user . ":" . $this->pass) . "\r\n";
764
765
        //add proxy auth headers
766
        if (!empty($this->proxy_user))
767
            $headers .= 'Proxy-Authorization: ' . 'Basic ' . base64_encode($this->proxy_user . ':' . $this->proxy_pass) . "\r\n";
@@ 766-768 (lines=3) @@
763
            $headers .= "Authorization: Basic " . base64_encode($this->user . ":" . $this->pass) . "\r\n";
764
765
        //add proxy auth headers
766
        if (!empty($this->proxy_user))
767
            $headers .= 'Proxy-Authorization: ' . 'Basic ' . base64_encode($this->proxy_user . ':' . $this->proxy_pass) . "\r\n";
768
769
770
        $headers .= "\r\n";
771
@@ 926-928 (lines=3) @@
923
        }
924
        if (!empty($body))
925
            $headers[] = "Content-length: " . strlen($body);
926
        if (!empty($this->user) || !empty($this->pass))
927
            $headers[] = "Authorization: BASIC " . base64_encode($this->user . ":" . $this->pass);
928
929
        for ($curr_header = 0; $curr_header < count($headers); $curr_header++) {
930
            $safer_header = strtr($headers[$curr_header], "\"", " ");
931
            $cmdline_params .= " -H \"" . $safer_header . "\"";