forwardemail / forwardemail/superagent

Get with queries not working in IE11 because of code using includes

Open
#1,561 2 comments 2 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
16.6k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

Get promise throws an error on IE
Object doesn't support property or method 'includes'

The get function wrapped into the promise below will throw an exception on IE

```return new Promise(function(resolve) {
get(config.baseUrl +'/api/xyz')
.set('Accept', 'application/json')
.set('Cache-Control', 'no-store')
.query({ x: y, y: z })
.end(function(error, res) {
if (res.status === 404 || error) {
resolve(null);
} else {
resolve(JSON.parse(res.text));
}
});
});
```

Seeing a lot of `includes` functionality in the code (request-base.js) :
`if (err.code && ERROR_CODES.includes(err.code)) return true;`

`this.url += (this.url.includes('?') ? '&' : '?') + query;`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.