Skip to content

Commit

Permalink
Merge branch 'master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
bearkfear authored Dec 5, 2020
2 parents 3a15c3a + d2807e5 commit f2c70f7
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 10 deletions.
8 changes: 6 additions & 2 deletions dist/cep-promise-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,10 +441,14 @@
method: 'GET',
mode: 'cors',
headers: {
'content-type': 'application/json;charset=utf-8',
'user-agent': ''
'content-type': 'application/json;charset=utf-8'
}
};

if (typeof window == 'undefined') {
options.headers['user-agent'] = 'cep-promise';
}

return fetch(url, options).then(analyzeAndParseResponse$1).then(checkForViaCepError).then(extractCepValuesFromResponse)["catch"](throwApplicationError$1);
}

Expand Down
2 changes: 1 addition & 1 deletion dist/cep-promise-browser.min.js

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions dist/cep-promise.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,10 +392,14 @@
method: 'GET',
mode: 'cors',
headers: {
'content-type': 'application/json;charset=utf-8',
'user-agent': ''
'content-type': 'application/json;charset=utf-8'
}
};

if (typeof window == 'undefined') {
options.headers['user-agent'] = 'cep-promise';
}

return fetch(url, options).then(analyzeAndParseResponse$1).then(checkForViaCepError).then(extractCepValuesFromResponse)["catch"](throwApplicationError$1);
}

Expand Down
2 changes: 1 addition & 1 deletion dist/cep-promise.min.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cep-promise",
"version": "4.0.2",
"version": "4.0.3",
"description": "Busca por CEP integrado diretamente aos serviços dos Correios e ViaCEP",
"main": "dist/cep-promise.min.js",
"module": "dist/cep-promise.min.js",
Expand Down Expand Up @@ -35,7 +35,8 @@
"zipcode",
"zip",
"promise",
"viacep"
"viacep",
"brasilapi"
],
"homepage": "https://github.com/BrasilAPI/cep-promise",
"devDependencies": {
Expand Down
7 changes: 5 additions & 2 deletions src/services/viacep.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@ export default function fetchViaCepService (cepWithLeftPad, proxyURL = '') {
method: 'GET',
mode: 'cors',
headers: {
'content-type': 'application/json;charset=utf-8',
'user-agent': ''
'content-type': 'application/json;charset=utf-8'
}
}

if (typeof window == 'undefined') {
options.headers['user-agent'] = 'cep-promise'
}

return fetch(url, options)
.then(analyzeAndParseResponse)
.then(checkForViaCepError)
Expand Down

0 comments on commit f2c70f7

Please sign in to comment.