Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: AxiosRequestConfig.proxy should allow type false #1154

Closed
dhcmrlchtdj opened this issue Oct 30, 2017 · 2 comments
Closed

bug: AxiosRequestConfig.proxy should allow type false #1154

dhcmrlchtdj opened this issue Oct 30, 2017 · 2 comments

Comments

@dhcmrlchtdj
Copy link
Contributor

#### Summary

I can't create an instance with axios.create({proxy: false}).
tsc report

error TS2345: Argument of type '{ proxy: boolean; }' is not assignable to parameter of type 'AxiosRequestConfig | undefined'.
  Type '{ proxy: boolean; }' is not assignable to type 'AxiosRequestConfig'.
    Types of property 'proxy' are incompatible.
      Type 'boolean' is not assignable to type 'AxiosProxyConfig | undefined'.

The typing should be AxiosProxyConfig | false, however false is missing at current version.

proxy?: AxiosProxyConfig;

if (!proxy && proxy !== false) {

#### Context

  • axios version: v0.17.0
@nickuraltsev
Copy link
Member

Right! I'd be happy to accept a PR.

dhcmrlchtdj pushed a commit to dhcmrlchtdj/axios that referenced this issue Nov 12, 2017
dhcmrlchtdj pushed a commit to dhcmrlchtdj/axios that referenced this issue Nov 12, 2017
dhcmrlchtdj added a commit to dhcmrlchtdj/axios that referenced this issue Nov 12, 2017
nickuraltsev added a commit that referenced this issue Nov 12, 2017
@nickuraltsev
Copy link
Member

Fixed via #1177

@axios axios locked and limited conversation to collaborators May 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants