-
Notifications
You must be signed in to change notification settings - Fork 312
Closed
Description
Em minha requisição pelo reactjs está vindo o seguinte erro:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://viacep.com.br/ws/01310940/json/. (Reason: header ‘user-agent’ is not allowed according to header ‘Access-Control-Allow-Headers’ from CORS preflight response)
Alguma solução?
Função utilizada:
import cep_promoise from 'cep-promise';
import {states} from './Cities_States';
export async function getAddressProfile (zipcode) {
try {
const response = await cep_promoise(zipcode);
return {
...response,
state: states.find(data => data.sigla === response.state).nome
};
} catch (err) {
return err;
}
}
Metadata
Metadata
Assignees
Labels
No labels