openid / AppAuth-JS

JavaScript client SDK for communicating with OAuth 2.0 and OpenID Connect providers.
Apache License 2.0
977 stars 162 forks source link

Avoid use of `includes()` for IE #117

Closed jakefeasel closed 5 years ago

jakefeasel commented 5 years ago

Expected Behavior

When using a fetch polyfill with IE, the current "FetchRequestor" implementation should be suitable.

Describe the problem

The FetchRequestor implementation uses the includes method. As you can see from the browser compatibility table, Internet Explorer does not support this function. Therefore, an additional polyfill would have to be added just to handle this one use of includes.

[REQUIRED] Actual Behavior

AppAuth-JS with a fetch polyfill in IE 11 fails (in particular, when making a request that isn't specifically a json data type).

[REQUIRED] Steps to reproduce the behavior

Use AppAuth-JS in Internet Explorer 11, with a fetch polyfill (whatwg-fetch, for example). Then make a token revocation request - this type doesn't expect JSON, and so the problematic includes code checking the content type will be triggered (and will fail).

[REQUIRED] Environment

tikurahul commented 5 years ago

Thanks for the PR. The changes look good.

tikurahul commented 5 years ago

Can you please sign the CLA ?

jakefeasel commented 5 years ago

Sorry for the delay; my first attempt at filling out the forms was incorrect. All resolved now.