Skip to content

Commit

Permalink
fix #108
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickarlt committed Jan 31, 2018
1 parent f12822c commit 35b89ba
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/arcgis-rest-request/src/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export function request(
requestOptions: IRequestOptions = { params: { f: "json" } }
): Promise<any> {
const options: IRequestOptions = {
...{ httpMethod: "POST", fetch: fetch.bind(Function("return this")()) },
...{ httpMethod: "POST", fetch },
...requestOptions
};

Expand Down Expand Up @@ -135,6 +135,10 @@ export function request(
);
}

if (options.fetch === fetch) {
options.fetch = fetch.bind(Function("return this")());
}

const { httpMethod, authentication } = options;

const params: IParams = {
Expand Down

0 comments on commit 35b89ba

Please sign in to comment.