Skip to content

Commit

Permalink
removing proxy disabling
Browse files Browse the repository at this point in the history
  • Loading branch information
ivmarcos committed Jan 30, 2019
1 parent 1c66093 commit ff174b5
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/services/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,11 @@ function isBrowser(){
return typeof window !== 'undefined';
}

/* istanbul ignore next */
function isHttps(){
return typeof location !== 'undefined' && location.protocol === 'https:'
}

/* istanbul ignore next */
function shouldUseProxy(){
return isBrowser() && !isHttps()
}

/* istanbul ignore next */
function injectProxy (Service) {
return (cepWithLeftPad) => Service(cepWithLeftPad, PROXY_URL)
}

export const CepAbertoService = shouldUseProxy() ? injectProxy(CepAberto) : CepAberto
export const CorreiosService = shouldUseProxy() ? injectProxy(Correios) : Correios
export const CepAbertoService = isBrowser() ? injectProxy(CepAberto) : CepAberto
export const CorreiosService = isBrowser() ? injectProxy(Correios) : Correios
export const ViaCepService = ViaCep

0 comments on commit ff174b5

Please sign in to comment.