2
0
mirror of https://github.com/tenrok/axios.git synced 2026-05-27 14:47:43 +03:00
Commit Graph

904 Commits

Author SHA1 Message Date
Xianming Zhong 7df84a7ff7 Revert finally as then (#2683)
Co-authored-by: Yasu Flores <carlosyasu91@gmail.com>
2020-01-22 12:18:22 -08:00
Emily Morehouse 2a0ff479f9 Releasing 0.19.2 2020-01-21 21:24:50 -07:00
Emily Morehouse 17cc1d6d7a Updating changlog for 0.19.2 release 2020-01-20 09:24:56 -07:00
Xianming Zhong c7488c7dd5 Remove unnecessary XSS check introduced by #2451 (#2679)
* Remove unnecessary XSS check introduced by #2451

* Remove test file of `isValidXss`
2020-01-20 09:20:33 -07:00
Emily Morehouse 351cf290f0 Fix link formatting in CHANGELOG.md to display PR number in parens as link (#2643) 2020-01-07 11:54:03 -07:00
Emily Morehouse 960e1c8798 Releasing 0.19.1 2020-01-07 10:21:04 -07:00
Malik Dirim 8a9421de0f Fixing typo in CHANGELOG.md: s/Functionallity/Functionality (#2639) 2020-01-07 09:31:54 -07:00
不才 ee47120a09 If this place is false, it will report an error, so you should delete the useless code. (#2458) 2019-12-25 13:00:15 -08:00
Michael Shin 03e6f4bf4c Fixing invalid agent issue (#1904) 2019-12-25 12:55:36 -08:00
ZhaoXC dc4bc49673 fix: fix ignore set withCredentials false (#2582) 2019-12-08 23:52:45 -08:00
Alanscut 13c948e661 Remove 'includes' API, fix CI build failure (#2574)
* Remove 'includes' API, fix CI build failure
2019-12-09 10:28:37 +08:00
Alanscut fa6cf01c91 fixing Travis link (#2540) 2019-12-09 09:14:52 +08:00
Alanscut a17c70cb5a Fix CI build failure (#2570) 2019-11-26 11:09:42 -08:00
Angelos Chalaris 1a32ca0601 Remove dependency on is-buffer (#1816)
* Remove dependency on is-buffer from package.json
2019-11-17 22:53:27 -08:00
Yasu Flores 0cc22c2f42 Fix badge, use master branch (#2538) 2019-11-15 19:32:37 -08:00
Yasu Flores 841466416b Fix XSS logic that matched some valid urls (#2529)
* Fix XSS logic that matched some valid urls, e.g. "/one/?foo=bar", when it shouldn't match those
2019-11-07 18:39:24 -08:00
Luke Policinski bbfd5b1395 Adding options typings (#2341) 2019-11-03 21:17:27 -08:00
Yasu Flores 55aaebcbf5 Document fix (#2514) 2019-11-03 20:56:17 -08:00
Yasu Flores 86d77504c2 Update docs with no_proxy change, issue #2484 (#2513) 2019-11-03 20:54:19 -08:00
Marlon Barcarol b0afbedf1b Adding Typescript HTTP method definition for LINK and UNLINK. (#2444) 2019-11-03 19:29:51 -08:00
Harshit Singh fa68fd30c3 Update README.md (#2504) 2019-11-03 18:30:49 -08:00
Felipe Martins 097948698a Revert "Update Webpack + deps, remove now unnecessary polyfills" (#2479)
* Revert "Update Webpack + deps, remove now unnecessary polyfills (#2410)"

This reverts commit 189b34c45a.

* Fix build (#2496)

* Change syntax to see if build passes

* Test commit

* Test with node 10

* Test adding all browsers in travis

* remove other browsers when running on travis
2019-10-25 11:34:47 -03:00
Yasu Flores 494d817314 Change syntax to see if build passes (#2488)
* Change syntax to see if build passes

* Test commit

* Test with node 10

* Test adding all browsers in travis

* remove other browsers when running on travis
2019-10-25 11:25:53 -03:00
Avindra Goolcharan 189b34c45a Update Webpack + deps, remove now unnecessary polyfills (#2410)
* Update deps

 * handles webpack 1 -> 4 migration

* remove promise helpers from dev files

assume `Promise` is available, or polyfilled by
the consumer

* Remove isArray util. `isArray` has good coverage, even
   in IE9. So lets remove the custom polyfill.

 https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray

also resolves a few lint issues

* Remove trim util

String.protoype.trim has good coverage (including IE9)

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim

Also, the http adapter already uses the native method.
2019-10-21 15:56:29 -03:00
Yasu Flores 29da6b24db Fix to prevent XSS, throw an error when the URL contains a JS script (#2464)
* Fixes issue where XSS scripts attacks were possible via the URL

* Fix error

* Move throwing error up

* Add specs and make regex cover more xss cases
2019-10-16 07:53:10 -03:00
Crhistian Ramirez ee60ee368e Fixing missing words in docs template (#2259) 2019-10-15 22:32:19 -03:00
IVLIU 6284abfa06 custom timeout prompt copy (#2275)
* style: ui

* feat: custom timeout txtx

* feat: custom timeout txtx
2019-10-15 22:29:16 -03:00
Yasu Flores ccca5e0e21 Add error toJSON example (#2466) 2019-10-15 22:20:56 -03:00
Wataru 19969b4fbd Fixing Vulnerability A Fortify Scan finds a critical Cross-Site Scrip… (#2451)
* Fixing Vulnerability A Fortify Scan finds a critical Cross-Site Scripting

* use var insted of const
2019-10-08 21:23:34 -03:00
Maskedman99 4f189ec80c Add license badge (#2446)
MIT License badge added in README.md file
2019-10-04 15:47:49 +02:00
Felipe Martins 85c9d4ffb0 fix: Fixing subdomain handling on no_proxy (#2442) 2019-09-28 20:51:20 -03:00
Jeremie Thomassey 00cd48027b Make redirection from HTTP to HTTPS work (#2426)
When calling an HTTP resource redirecting to a HTTPS one with a keepAlive agent. We get the following error:
```
TypeError [ERR_INVALID_PROTOCOL]: Protocol "https:" not supported. Expected "http:"
    at new ClientRequest (_http_client.js:119:11)
    at Object.request (https.js:281:10)
    at RedirectableRequest._performRequest (/Users/jthomassey/projects/ecom-shop-web/node_modules/follow-redirects/index.js:169:24)
    at RedirectableRequest._processResponse (/Users/jthomassey/projects/ecom-shop-web/node_modules/follow-redirects/index.js:260:10)
    at ClientRequest.RedirectableRequest._onNativeResponse (/Users/jthomassey/projects/ecom-shop-web/node_modules/follow-redirects/index.js:50:10)
    at Object.onceWrapper (events.js:277:13)
    at ClientRequest.emit (events.js:189:13)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:556:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:109:17)
    at Socket.socketOnData (_http_client.js:442:20)
```

This can be tested here : 
```
const http = require('http');
const https = require('https');
const axios = require('axios');

axios.get('http://www.photobox.fr', { httpAgent: http.Agent({ keepAlive:true }), httpsAgent: https.Agent({ keepAlive:true }) })
  .then(response => {
    console.log(response);
    console.log(response.headers);
  })
  .catch(error => {
    console.log(error);
  });
```

Axios delegate the redirection to the follow-redirect package which accept an option `agents` for both http and https agent see : https://github.com/follow-redirects/follow-redirects#per-request-options
2019-09-26 09:33:49 -03:00
Tiago Rodrigues 006b60425c Add toJSON property to AxiosError type (#2427)
I noticed the error object has a `toJSON` method but when I tried to use it in my typescript code it complained it didn't exist, even though I was using the `AxiosError` type.
2019-09-26 09:11:34 -03:00
Jihwan Oh 88dbb82d77 Fix word 'sintaxe' to 'syntax' in README.md (#2432)
- translate 'sintaxe' word from portuguese to english
2019-09-25 21:18:44 -03:00
Ya Hui Liang(Ryou) 93e69625a6 Fixing socket hang up error on node side for slow response. (#1752)
* Fixing socket hang up error on node side for slow response.

* eslint check
2019-09-16 05:58:58 -03:00
Ahmed Tarek d74385f1c8 🐛Fix request finally documentation in README (#2189) 2019-09-13 10:19:43 -03:00
Joshua Melvin 1b07fb9365 Fixing issue 2195 - order of if/else blocks is causing unit tests mocking XHR. (#2201) 2019-09-13 09:35:59 -03:00
Fabio Aiello c454e9f526 updating spelling and adding link to docs (#2212) 2019-09-13 09:31:49 -03:00
Vamp e3a7116f14 upadating README: notes on CommonJS autocomplete (#2256)
closes #2226. add note on how to gain typings / autocomplete / intellisense when using CommonJS (`require()`) imports
2019-09-13 09:28:14 -03:00
Lucas 488a4598a3 Sintaxe alternative to send data into the body (#2317) 2019-09-13 09:19:16 -03:00
James George f7e2a995d6 docs: minor tweak (#2404)
made the license section link up to the respective file.
2019-09-13 09:10:55 -03:00
Felipe Martins c282e7ea8e Fix cancellation error on build master. #2290 #2207 (#2407) 2019-09-12 23:45:06 -03:00
Sagar Acharya f5704fce71 Update response interceptor docs (#2399) 2019-09-12 22:30:36 -03:00
Avindra Goolcharan 6a4a85c57f Doc fixes, minor examples cleanup (#2198)
* README.md COOKBOOK.md: minor fixes

 * simplify language

* ECOSYSTEM: create a few categories

* Examples: log port listening to

* upgrade bootstrap 3 -> 4 in examples

bootstrap 4 is slightly smaller then 3.2.0
so it should also help load examples faster

* categorize 0.19 items a little differently

surface user/consumer changes first
2019-09-07 09:05:26 -03:00
Rafael Renan Pacheco a11cdf4683 Fixing custom config options (#2207)
- fixes #2203
2019-09-06 21:40:04 -03:00
bushuai e50a08b2c3 Fixing set config.method after mergeConfig for Axios.prototype.request (#2383)
Inside Axios.prototype.request function, It's forced to set
method to 'get' after `mergeConfig` if config.method exists, which makes the defaults.method not effective.
2019-09-06 14:23:55 -03:00
DIO 89bd3abe9a Axios create url bug (#2290)
* Fix #2234 

* added spacing --eslint

* added test cases

* removed unexpected cases after updating the code
2019-09-06 12:45:18 -03:00
Michael Foss b9931e0a95 Fix grammar in README.md (#2271) 2019-09-06 12:42:10 -03:00
Denis Sikuler f0f68afb61 Fix a typo in README (#2384) 2019-09-06 09:55:06 -03:00
multicolaure 6fe506fda2 Do not modify config.url when using a relative baseURL (resolves #1628) (#2391)
* Adding tests to show config.url mutation

Because config.url is modified while processing the request
when the baseURL is set,
it is impossible to perform a retry with the provided config object.

Ref #1628

* Fixing url combining without modifying config.url

As config.url is not modified anymore during the request processing.
The request can safely be retried after it failed with the provided
config.

resolves #1628
2019-09-05 12:43:55 -03:00