Skip to content

Commit

Permalink
ex 0.17.11
Browse files Browse the repository at this point in the history
  • Loading branch information
yinhangfeng committed Nov 15, 2017
2 parents 8fa91dd + d7f021b commit 82b1365
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 13 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

### 0.17.1 (Nov 11, 2017)

- Fixing issue with web workers ([#1160](https://github.com/axios/axios/pull/1160))
- Allowing overriding transport ([#1080](https://github.com/axios/axios/pull/1080))
- Updating TypeScript typings ([#1165](https://github.com/axios/axios/pull/1165), [#1125](https://github.com/axios/axios/pull/1125), [#1131](https://github.com/axios/axios/pull/1131))

### 0.17.0 (Oct 21, 2017)

- **BREAKING** Fixing issue with `baseURL` and interceptors ([#950](https://github.com/axios/axios/pull/950))
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "axios",
"main": "./dist/axios.js",
"version": "0.17.0",
"version": "0.17.1",
"homepage": "https://github.com/axios/axios",
"authors": [
"Matt Zabriskie"
Expand Down
11 changes: 8 additions & 3 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export interface AxiosTransformer {
(data: any): any;
(data: any, headers?: any): any;
}

export interface AxiosAdapter {
Expand All @@ -14,6 +14,10 @@ export interface AxiosBasicCredentials {
export interface AxiosProxyConfig {
host: string;
port: number;
auth?: {
username: string;
password:string;
}
}

export interface AxiosRequestConfig {
Expand Down Expand Up @@ -41,7 +45,7 @@ export interface AxiosRequestConfig {
maxRedirects?: number;
httpAgent?: any;
httpsAgent?: any;
proxy?: AxiosProxyConfig;
proxy?: AxiosProxyConfig | false;
cancelToken?: CancelToken;
}

Expand All @@ -51,6 +55,7 @@ export interface AxiosResponse<T = any> {
statusText: string;
headers: any;
config: AxiosRequestConfig;
request?: any;
}

export interface AxiosError extends Error {
Expand Down Expand Up @@ -92,7 +97,7 @@ export interface CancelTokenSource {
}

export interface AxiosInterceptorManager<V> {
use(onFulfilled: (value: V) => V | Promise<V>, onRejected?: (error: any) => any): number;
use(onFulfilled?: (value: V) => V | Promise<V>, onRejected?: (error: any) => any): number;
eject(id: number): void;
}

Expand Down
4 changes: 3 additions & 1 deletion lib/adapters/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ module.exports = function httpAdapter(config) {
}

var transport;
if (config.maxRedirects === 0) {
if (config.transport) {
transport = config.transport;
} else if (config.maxRedirects === 0) {
transport = isHttps ? https : http;
} else {
if (config.maxRedirects) {
Expand Down
3 changes: 1 addition & 2 deletions lib/adapters/xhr.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ module.exports = function xhrAdapter(config) {
// Only supports POST and GET calls and doesn't returns the response headers.
// DON'T do this for testing b/c XMLHttpRequest is mocked, not XDomainRequest.
// 不支持 XDomainRequest
// if (!window.XMLHttpRequest &&
// process.env.NODE_ENV !== 'test' &&
// if (process.env.NODE_ENV !== 'test' &&
// typeof window !== 'undefined' &&
// window.XDomainRequest && !('withCredentials' in request) &&
// !isURLSameOrigin(config.url)) {
Expand Down
8 changes: 4 additions & 4 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,10 @@ function forEach(obj, fn) {
}

// Force an array if not already something iterable
// if (typeof obj !== 'object' && !isArray(obj)) {
// /*eslint no-param-reassign:0*/
// obj = [obj];
// }
if (typeof obj !== 'object') {
/*eslint no-param-reassign:0*/
obj = [obj];
}

if (isArray(obj)) {
// Iterate over array values
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ex-axios",
"version": "0.17.10",
"version": "0.17.11",
"description": "Promise based HTTP client for the modern browser and react-native",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -75,7 +75,7 @@
},
"typings": "./index.d.ts",
"dependencies": {
"follow-redirects": "^1.2.3",
"follow-redirects": "^1.2.5",
"is-buffer": "^1.1.5"
},
"bundlesize": [
Expand Down

0 comments on commit 82b1365

Please sign in to comment.