Граф коммитов

153 Коммитов

Автор SHA1 Сообщение Дата
David de Regt 4e98b51924
Merge pull request #20 from berickson1/alreadyAbortedCrash
Fix a bug that caused an assert if a request was canceled (via promis…
2017-12-22 21:47:24 -08:00
Brent Erickson b23126266c Fix a bug that cuased an assert if a request was canceled (via promise chaining) before it was fired 2017-12-22 19:33:27 -07:00
David de Regt b7f96806eb
Merge pull request #19 from Microsoft/markda/WebTransportResponse
0.1.4: Exposing WebTransportResopnse for the original interfaces (without request bits)…
2017-11-21 17:19:13 -08:00
Mark Davis 512e061157 0.1.4: Exposing WebTransportResopnse for the original interfaces (without request bits) to allow transport-agnostic usage of the interfaces. For example, WebSockets do not have the same type of request options or use headers the same way. 2017-11-21 16:59:47 -08:00
David de Regt ef5c8d3341
Merge pull request #17 from Microsoft/markda/ResponseHasRequest
0.1.3: Expose request bits from WebResponse...
2017-11-16 19:26:27 -08:00
Mark Davis adfb72dbff 0.1.3: Expose request bits from WebResponse. The exact headers are not known until the request is sent, so the caller does not have them (except in simple cases). Also, the request options are useful to return in case the 'caller' is a helper function that creates the request and thus the original caller does not necessarily have that information. 2017-11-16 17:56:02 -08:00
David de Regt a68bd4d2cb Bumping to 0.1.2 to pick up the readyState === 4 fix. 2017-11-14 09:18:46 -08:00
David de Regt 4fd62b5dd0
Merge pull request #16 from isnotgood/master
Resolve succesfully only when XHR.readyState is done.
2017-11-14 09:17:37 -08:00
Lukas Weber f2b85860d7 Resolve succesfully only when XHR.readState is done. 2017-11-14 01:15:56 +01:00
David de Regt d4385343b8 0.1.1: Bumping synctasks to ^0.3.0 2017-11-08 20:34:39 -08:00
David de Regt f6ef6c4a8c 0.1.0: Stopping abusing casting things around as <any> and using an explicit non-templated base class for SimpleWebRequest. Cleaning up usages of null and replacing with undefined/optional parameters where necessary. Stopped using lodashMini since babel plugins exist now to do that for us. Lots of other misc cleanup along the way to bring it up to date with newer coding styles on the team. 2017-10-25 22:30:42 -07:00
David de Regt 378a1948d6 Cleaned up SRC for strict null checks, newer Typescript/Tslint, and other compile flags. 2017-10-25 16:13:30 -07:00
Brent Erickson f3594da143 Fix an issue with double-aborting in RN due to recent behavioural change (#12)
On React Native, abort requires a call across the bridge making it more async than a typical browser. Since promise resolution is used to determine when a network request is completed (including the abort/cancel case), it's possible for abort() to be called twice OR for a network request success to arrive before the abort is fully processed.

* Don't double count retries if the abort call comes back synchronously

* Bump version for publish
2017-10-11 11:20:41 -07:00
David de Regt a4cf1fcca3 0.0.20 bump 2017-10-11 00:05:11 -07:00
David de Regt f911c2c6a8 Merge pull request #11 from SeriousJul/master
Allow aborted requested to be handled by custom policy
2017-10-11 00:04:11 -07:00
Julien Antony f6ba178869 Default policy don't retry on canceled call 2017-10-11 08:50:18 +02:00
Julien Antony 37e4b49352 Default policy don't retry on aborted call 2017-10-11 08:47:57 +02:00
Julien Antony db0313f459 Allow aborted requested to be handled by custom policy
- Allow customErrorHandler on aborted call
- Allow retry on aborted call
- Fix: Avoid duplicate call to _respond when the xhr was manually aborted (ie: when timeout is specified)
2017-10-10 10:32:42 +02:00
David de Regt 218e9f179b Bumping version to 0.0.19 for release 2017-09-07 09:22:10 -07:00
David de Regt 4486b3d727 Merge pull request #9 from msdevweb/master
Allowing text/xml & application/xml endpoints response handling
2017-09-06 10:06:47 -07:00
Mario Santos bcfb08b7b7 Allowing text/xml & application/xml endpoints response handling 2017-09-06 10:06:30 +02:00
Mark Davis 47ce2aa803 [0.0.18] Better headers flow. Headers are now updated right before firing each attempt instead of using a static set of headers on construction. Use options.overrideGetHeaders for a static set of headers (replacing the deprecated options.headers). (#7) 2017-07-20 18:52:45 -07:00
David de Regt a240997a87 0.0.17: Fixing SimpleWebRequest.setHeader() to work with strictnullchecks 2017-07-13 21:34:02 -07:00
David de Regt 570209207e Bump to 0.0.16 for Taavi's responseURL change 2017-07-06 13:36:26 -07:00
David de Regt 6c26a34efe Merge pull request #6 from taavikuusik/use-response-url
Changed WebResponse.url to use XHR.responseURL instead of initial req…
2017-07-06 13:35:27 -07:00
Taavi Kuusik 90703104ff Added fallback 2017-07-03 13:32:13 -07:00
Taavi Kuusik 29b0f364b2 Changed WebResponse.url to use XHR.responseURL instead of initial request url 2017-06-30 16:49:05 -07:00
David de Regt ffec8ebb46 Tweaking build scripts and fixing a small issue with Shir's commit 2017-06-26 13:14:44 -07:00
David de Regt dbc98e780c bumping to 0.0.15 for Shir's change 2017-06-26 13:09:23 -07:00
David de Regt e5e437312d Merge pull request #5 from lshir/formdata
Add support for formData
2017-06-26 13:08:41 -07:00
Shir Levkowitz 87408a3d9c Add formdata 2017-06-26 12:57:22 -04:00
Brent Erickson 6889e8b931 [0.0.14] Update check around empty headers to drop the header instead of asserting (#4)
Passing empty headers into RN Android no longer crashes, but it does drop the entire header array, so we should still protect against that.
The existing check was incorrectly matching empty string in the assert.
191db90345
2017-06-22 10:12:30 -07:00
Jakub Janovič 8da3fcc2a2 Moving from lodash lib dependency to it's subset (#3)
* Adding @types/lodash
* replace lodash dependency with sub-dependencies
* Adding tslinting
2017-05-17 14:46:28 -07:00
David de Regt 52850ae166 [0.0.13] Fixing an issue where xhr.open() explodes (i.e. CSP violations), blocking all future simple web requests. 2017-05-05 13:43:12 -07:00
Brent Erickson f92927c7cd [0.0.12] Bump package.json for release 2017-05-01 13:43:41 -07:00
Brent Erickson 4fcb87dadc When canceling a promise for a request, respond synchonously, don't rely on the xhr onCancel callback 2017-05-01 13:32:31 -07:00
Brent Erickson 20733871ea Add Method and Url to multi-aborted request message 2017-04-05 14:25:35 -07:00
David de Regt 0e4f3a843a 0.0.10: Added ApiCallOptions to the getHeaders call. 2016-12-19 17:29:24 -08:00
David de Regt 81a9232960 0.0.9: Add typing to PUT/DELETE calls on GenericRestClient 2016-12-19 13:10:57 -08:00
David de Regt 3e1cbbc6fb 0.0.8: Preventing double-aborts in weird edge cases with paused/resumed requests getting timed out later. Added some more assertions to help catch cases like this in the future. 2016-12-16 17:42:25 -08:00
David de Regt 0ec2a3071e Fixing edge case Mark noticed 2016-12-15 19:07:51 -08:00
David de Regt 2d3dbf0932 0.0.7: Added setHeader call for handling retries with updated headers. Fixed bug with RetryUncountedImmediately not actually retrying immediately. Added ability to pause/resume requests after errors. 2016-12-15 18:51:24 -08:00
David de Regt b6c67ef344 0.0.6: Fixing bug in retry logic for DoNotRetry options 2016-11-18 17:47:07 -08:00
Brent Erickson 7f65075fd9 Move timeout handler to after calling xhr.open. IE11 doesn't like having this handler first 2016-11-18 12:22:48 -08:00
Mark Davis 0ff792117c Trying to force d.ts files to not reference lodash as a type, since they are not importing it correctly as a module. 2016-11-17 15:33:17 -08:00
Brent Erickson 3adbad70e0 Bump package version to 0.0.3 2016-11-16 09:57:35 -08:00
Brent Erickson e9b6f5a1b1 Simplify some of the detection logic, only rely on the advanced methods when they were detected before the request started 2016-11-16 09:57:35 -08:00
Brent Erickson 46e898651b Add more logic to reduce number of potential double-fires of repsonse handler after aborting a request 2016-11-16 09:57:35 -08:00
Brent Erickson 44b1603bb1 Add feature detection for timeout
If native timeout is supported on xmlhttprequest, use that instead of using setTimeout
2016-11-16 09:57:35 -08:00
Brent Erickson 8dc92c04ac Use onLoad/onError callbacks from XMLHttpRequest if possible
Add detection logic so everything should continue to work on older browsers
2016-11-16 09:57:35 -08:00