diff --git a/src/CnpjGratis.php b/src/CnpjGratis.php index 22fb87d..589af80 100644 --- a/src/CnpjGratis.php +++ b/src/CnpjGratis.php @@ -13,17 +13,17 @@ class CnpjGratis { */ public static function getParams() { - $data = self::request('http://servicos.receita.fazenda.gov.br/Servicos/cnpjreva/Cnpjreva_Solicitacao.asp'); + $data = self::request('https://servicos.receita.fazenda.gov.br/Servicos/cnpjreva/Cnpjreva_Solicitacao.asp'); $cookie = $data['headers']['Set-Cookie']; - $image = self::request('http://servicos.receita.fazenda.gov.br/Servicos/cnpjreva/captcha/gerarCaptcha.asp', [], [ + $image = self::request('https://servicos.receita.fazenda.gov.br/Servicos/cnpjreva/captcha/gerarCaptcha.asp', [], [ "Pragma: no-cache", - "Origin: http://www.receita.fazenda.gov.br", + "Origin: https://www.receita.fazenda.gov.br", "Host: servicos.receita.fazenda.gov.br", "User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:32.0) Gecko/20100101 Firefox/32.0", "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Accept-Language: pt-BR,pt;q=0.8,en-US;q=0.5,en;q=0.3", "Accept-Encoding: gzip, deflate", - "Referer: http://servicos.receita.fazenda.gov.br/Servicos/cnpjreva/Cnpjreva_Solicitacao.asp", + "Referer: https://servicos.receita.fazenda.gov.br/Servicos/cnpjreva/Cnpjreva_Solicitacao.asp", "Cookie: flag=1; $cookie", "Connection: keep-alive" ]); @@ -57,7 +57,7 @@ public static function consulta($cnpj, $captchaSolved, $cookie) "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", "Accept-Language: pt-BR,pt;q=0.9,en;q=0.8", "Accept-Encoding: gzip, deflate", - "Referer: http://servicos.receita.fazenda.gov.br/Servicos/cnpjreva/Cnpjreva_Solicitacao_CS.asp", + "Referer: https://servicos.receita.fazenda.gov.br/Servicos/cnpjreva/Cnpjreva_Solicitacao_CS.asp", "Cookie: $cookie", "Connection: keep-alive" ]; @@ -67,7 +67,7 @@ public static function consulta($cnpj, $captchaSolved, $cookie) 'txtTexto_captcha_serpro_gov_br' => $captchaSolved, 'search_type' => 'cnpj' ]; - $data = self::request('http://servicos.receita.fazenda.gov.br/Servicos/cnpjreva/valida.asp', $params, $headers); + $data = self::request('https://servicos.receita.fazenda.gov.br/Servicos/cnpjreva/valida.asp', $params, $headers); $crawler = new Crawler($data['response']); if(strpos($crawler->html(), 'Erro na Consulta') !== false){ throw new \RuntimeException('Erro ao consultar. Confira se vocĂȘ digitou corretamente os caracteres fornecidos na imagem.', 98); @@ -168,4 +168,4 @@ private static function request($uri, array $data = [], array $headers = []){ $response = substr($response, $size); return compact('response', 'headers'); } -} \ No newline at end of file +}