[Pkg-javascript-commits] [node-stream-http] 156/208: Always use example.com for feature testing

Bastien Roucariès rouca at moszumanska.debian.org
Sun Aug 13 13:39:39 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 34aa6847894740c71031621b3ef0197a83d1ac4b
Author: John Hiesey <john at hiesey.com>
Date:   Thu Oct 27 19:05:25 2016 -0700

    Always use example.com for feature testing
    
    Previously, there was some logic to use the page host
    when possible, but it was problematic still (e.g. #53).
    
    Just use example.com in all cases instead. Since the
    request is never sent, this shouldn't cause extra
    network traffic (except perhaps a dns lookup).
    
    Fixes #53
---
 lib/capability.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/capability.js b/lib/capability.js
index 804f13e..fa464b5 100644
--- a/lib/capability.js
+++ b/lib/capability.js
@@ -7,9 +7,9 @@ try {
 } catch (e) {}
 
 var xhr = new global.XMLHttpRequest()
-// If location.host is empty, e.g. if this page/worker was loaded
-// from a Blob, then use example.com to avoid an error
-xhr.open('GET', global.location.host ? '/' : 'https://example.com')
+// The previous heuristics for what host to use were fragile.
+// Hopefully this works better and doesn't cause problems.
+xhr.open('GET', 'https://example.com')
 
 function checkTypeSupport (type) {
 	try {

-- 
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