[Pkg-javascript-commits] [node-stream-http] 189/208: Fix Android tests
Bastien Roucariès
rouca at moszumanska.debian.org
Sun Aug 13 13:39:43 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-stream-http.
commit 46923f37d9f32d774e5742c26c3c4340dffeb916
Author: John Hiesey <john at hiesey.com>
Date: Sun May 7 23:27:26 2017 -0700
Fix Android tests
Not sure how this ever worked. This seems to have been broken for quite a while.
---
test/browser/headers.js | 7 ++++---
test/server/index.js | 1 +
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/test/browser/headers.js b/test/browser/headers.js
index 1054eda..aee0f7b 100644
--- a/test/browser/headers.js
+++ b/test/browser/headers.js
@@ -90,11 +90,12 @@ test('content-type response header', function (t) {
var browser = (new UAParser()).setUA(navigator.userAgent).getBrowser()
var browserName = browser.name
var browserVersion = browser.major
-var browserMinorVersion = browser.minor
+var browserMinorVersion = browser.minor || 0
// The content-type header is broken when 'prefer-streaming' or 'allow-wrong-content-type'
-// is passed in browsers that rely on xhr.overrideMimeType(), namely older chrome and safari 6-10.0
+// is passed in browsers that rely on xhr.overrideMimeType(), namely older chrome, safari 6-10.0, and the stock Android browser
var wrongMimeType = ((browserName === 'Chrome' && browserVersion <= 42) ||
- ((browserName === 'Safari' || browserName === 'Mobile Safari') && browserVersion >= 6 && (browserVersion < 10 || (browserVersion === 10 && browserMinorVersion === 0))))
+ ((browserName === 'Safari' || browserName === 'Mobile Safari') && browserVersion >= 6 && (browserVersion < 10 || (browserVersion == 10 && browserMinorVersion == 0)))
+ || (browserName === 'Android Browser'))
test('content-type response header with forced streaming', function (t) {
http.get({
diff --git a/test/server/index.js b/test/server/index.js
index 8f474b2..f9f45de 100644
--- a/test/server/index.js
+++ b/test/server/index.js
@@ -32,6 +32,7 @@ app.get('/testHeaders', function (req, res) {
})
res.setHeader('Content-Type', 'application/json')
+ res.setHeader('Cache-Control', 'no-cache')
// Request headers are sent in the body as json
var reqHeaders = {}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-stream-http.git
More information about the Pkg-javascript-commits
mailing list