Commit Graph

62 Commits

Author SHA1 Message Date
John Hiesey 80ef3ca4ed Improve test reliability and bump deps 2021-04-13 22:29:31 -07:00
John Hiesey 2572062eae Add timeout test 2021-04-13 16:27:08 -07:00
John Hiesey e60ce5fb99 Replace erroneous test disable 2018-10-02 21:45:10 -07:00
John Hiesey 0887fcf0b4 Major cleanup to remove IE10 and earlier support 2018-09-24 14:09:42 -07:00
John Hiesey 5bc3a7205e Add (disabled) test for timeout after success
Unfortunately, reasonable timeout lengths tend to cause
spurious failures, so this test shouldn't be enabled
normally.
2018-05-08 20:37:36 -07:00
John Hiesey f800fad249 Fix incorrect definition of http.IncomingMessage
Also add test for top-level http properties, plus a stub http.globalAgent
Fixes #81
2018-03-14 13:08:47 -07:00
John Hiesey 86bfe01159 Re-enable webworker test with workaround 2018-02-26 17:43:26 -08:00
John Hiesey e875fc72b0 Switch from zuul to airtap for tests 2018-02-21 22:22:04 -08:00
John Hiesey 0ecf194fa4 Remove test support for older browsers
Opera (all versions) and Safari < 7 aren't supported by sauce labs
anymore, so don't test them.
2018-01-15 01:16:31 -08:00
John Hiesey d4631b211c Change timeout behavior
Add opts.requestTimeout. Fixes #66
2018-01-15 01:16:31 -08:00
John Hiesey c2e1444670 Update documentation 2018-01-15 01:03:26 -08:00
John Hiesey 856a572341 fix tests on Safari 10.0 on iOS 10.3 2017-06-12 13:01:14 -07:00
John Hiesey 46923f37d9 Fix Android tests
Not sure how this ever worked. This seems to have been broken for quite a while.
2017-05-08 17:31:38 -07:00
John Hiesey 4cf6771177 Disable broken timeout test
timeout support is fairly broken; see #66
2017-04-03 23:43:08 -07:00
John Hiesey e54de15542 Handle arrays in request headers and improve header handling
Passing an array as a header value now works as in node.
Header handling with multiple values for the same header is also
tested, and mime type test updated for safari 10.1

Fixes #73
2017-04-03 22:25:57 -07:00
John Hiesey 943f5bc89d use blacklist instead of whitelist for methods with bodies
Instead of only permitting bodies on certain methods, only
prohibit them when the browser would give an error (with fetch)
or ignore them (with XHR). This allows bodies with custom
methods and is closer to the behavior of http in node.

Fixes #69
2017-04-03 20:25:20 -07:00
John Hiesey 1c25d6f3a3 bump dependency versions 2017-04-03 20:20:47 -07:00
John Hiesey 8df10e0d65 Avoid passing undefined to xhr.send()
Provides a more elegant fix to #67
2017-01-16 01:57:32 -08:00
John Hiesey 5ee30ad5cc Fix timeout test failure 2017-01-16 00:35:53 -08:00
Connor Peet 57d0ab245f Support timeout option in http.request 2016-10-17 19:17:44 -07:00
Alex J Burke 53bf1d38e2 Allow using a mode to disable the use of fetch and add a test for the case. 2016-09-01 07:48:38 +01:00
John Hiesey a0c6d49ba4 Expose response url
Fixes #39
2016-04-20 12:53:54 -07:00
John Hiesey 154f6b9e56 Fix buffer usage in tests as well 2016-01-12 22:18:41 +01:00
John Hiesey c36da3bade Use 'http:' as a default protocol
If global.location.protocol isn't 'http:' or 'https:', use
'http:'. This makes behavior reasonable when the page is
opened directly without using a server.
2016-01-09 03:55:14 +01:00
John Hiesey 75817ba930 Fix tests 2015-09-15 16:54:17 -07:00
John Hiesey 2152af414a Remove implementations of ES5 functions not provided in ie8
From now on, IE8 is only supported if polyfills for `Object.keys`,
`Array.prototype.forEach`, and `Array.prototype.indexOf` are
provided. The suggested polyfills from MDN are provided in
ie8-polyfill.js, or you can use https://github.com/es-shims/es5-shim
for a more complete set of polyfills.
2015-09-15 16:54:17 -07:00
John Hiesey a10d19b3b2 Fix occasional test errors on Chrome 45
If multiple chunks of data got queued up, the abort on data test
would erroneously fail. Wait till the end of the tick before
considering 'data' events as errors.
2015-09-15 16:52:11 -07:00
John Hiesey bde26be949 Add WebWorker test using webworkify 2015-09-14 23:25:24 -07:00
John Hiesey 8cab16f26e Change window to global for WebWorker support 2015-09-14 18:18:53 -07:00
John Hiesey bbf1fd81f0 Test handling of relative paths in urls
This adds the test from #17.
2015-09-11 20:09:20 -07:00
John Hiesey 6b9d3d107c Drastically simplify and improve url handling
Make options handling logic match node's `http` module more
closely and let the browser handle all of the relative url
cases itself.

This has a few important advantages:
* Behavior is closer to native `http` modula
* Relative paths in urls are handled properly (fixes #16)
* Code is simpler and more obviously correct
2015-09-11 20:06:13 -07:00
John Hiesey 3fda0048d7 Minor whitespace fixes in node test 2015-09-09 20:25:14 -07:00
John Hiesey bef2b95708 Fix IPv6 addresses in requests
Fixes #18
2015-09-09 20:25:14 -07:00
John Hiesey da4085e33d Make content-type header correct by default
The default behavior now preserves the 'content-type' header, at
the expense of not providing pseudo-streming in Safari, generic
WebKit, and older Chrome. Applications that require streaming
and already use 'prefer-stream' mode will not be affected.

The 'prefer-fast' mode is now deprecated, as that behavior now
matches the default. The 'allow-wrong-content-type' mode is new;
it gives the same behavior as the old default in case binary
streaming is essential.

Fixes #8
2015-08-20 01:01:40 -07:00
John Hiesey 1a4a89a5e4 Add test for data in request.end() 2015-08-07 18:02:33 -07:00
John Hiesey 9059849673 Make withCredentials default to false
This may break compatibility with code that was written for
`http-browserify`. Fixes #7
2015-07-20 16:01:24 -07:00
Cesar Andreu 588e5874f3 Add test for cookie behavior 2015-07-19 17:50:30 -07:00
John Hiesey 29a2ad2032 Add abort() test 2015-07-13 16:57:31 -07:00
John Hiesey cc4bdfb0e4 Remove extraneous logs in test server 2015-07-12 18:27:12 -07:00
John Hiesey 8a97dbd4cd Further increase number of copies in binary streaming test 2015-07-12 18:21:31 -07:00
John Hiesey fa5eb897ad Disable cache for testing server 2015-07-12 18:20:38 -07:00
John Hiesey 0876078d9e Try to make tests more reliable in both ie8 and firefox 2015-07-12 15:59:02 -07:00
John Hiesey a477858cc2 Test server cleanup 2015-07-12 15:19:15 -07:00
John Hiesey 4eed14a948 Readme improvements 2015-07-07 22:21:01 -07:00
John Hiesey f0b2220359 Clean up polyfill 2015-07-07 21:36:10 -07:00
John Hiesey 738b8e2747 Disable error handling test due to problems on sauce labs 2015-07-07 20:24:35 -07:00
John Hiesey 03ba151a6f Test prefer-binary 2015-07-07 19:02:22 -07:00
John Hiesey ad930c6041 Fix test failures 2015-07-07 17:23:32 -07:00
John Hiesey 4232780821 Add POST tests and fix test failures 2015-07-07 16:35:16 -07:00
John Hiesey 98a3dadbdf Fix basic auth support and add test 2015-07-07 14:35:15 -07:00