Skip to content

Commit 43fbb00

Browse files
committed
chore: bump lib version
1 parent e5ef7ba commit 43fbb00

File tree

5 files changed

+19
-13
lines changed

5 files changed

+19
-13
lines changed

dist/cep-promise-browser.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -435,14 +435,16 @@
435435
}
436436

437437
function fetchCorreiosAltAPIService(cepWithLeftPad, configurations) {
438-
var url = 'https://buscacepinter.correios.com.br/app/cep/carrega-cep.php';
438+
var url = 'https://buscacepinter.correios.com.br/app/endereco/carrega-cep-endereco.php';
439439
var options = {
440440
method: 'POST',
441441
mode: 'cors',
442442
headers: {
443-
'content-type': 'application/x-www-form-urlencoded; charset=UTF-8'
443+
'content-type': 'application/x-www-form-urlencoded; charset=UTF-8',
444+
'Referer': 'https://buscacepinter.correios.com.br/app/endereco/index.php',
445+
'Referrer-Policy': 'strict-origin-when-cross-origin'
444446
},
445-
body: "cep=".concat(cepWithLeftPad),
447+
body: "endereco=".concat(cepWithLeftPad, "&tipoCEP=ALL"),
446448
timeout: configurations.timeout || 30000
447449
};
448450
return fetch(url, options).then(parseResponse).then(extractCepValuesFromResponse)["catch"](throwApplicationError$1);
@@ -542,12 +544,13 @@
542544
}
543545

544546
function fetchWideNetService(cepWithLeftPad, configurations) {
545-
var url = "https://ws.apicep.com/busca-cep/api/cep/".concat(cepWithLeftPad, ".json");
547+
var cepWithDash = "".concat(cepWithLeftPad.slice(0, 5), "-").concat(cepWithLeftPad.slice(5));
548+
var url = "https://cdn.apicep.com/file/apicep/".concat(cepWithDash, ".json");
546549
var options = {
547550
method: 'GET',
548551
mode: 'cors',
549552
headers: {
550-
'content-type': 'application/json;charset=utf-8'
553+
accept: 'application/json'
551554
},
552555
timeout: configurations.timeout || 30000
553556
};

0 commit comments

Comments
 (0)