[Pkg-mozext-commits] [perspectives-extension] 14/22: Perspectives, Pers_gen - Allow https queries
David Prévot
taffit at moszumanska.debian.org
Mon May 12 17:17:43 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch debian
in repository perspectives-extension.
commit 2d9c20cf3109f348d8598b54145cbc7a1220f625
Author: Dave Schaefer <dave.schaefer at gmail.com>
Date: Mon May 5 23:13:32 2014 -0600
Perspectives, Pers_gen - Allow https queries
For now, turn these on by adding 'https' in front of the notary name.
And thus begins the road to HTTPS.
---
plugin/chrome/content/generate_svg.js | 3 ++-
plugin/chrome/content/notaries.js | 7 ++++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/plugin/chrome/content/generate_svg.js b/plugin/chrome/content/generate_svg.js
index f17c783..0b3d837 100644
--- a/plugin/chrome/content/generate_svg.js
+++ b/plugin/chrome/content/generate_svg.js
@@ -109,9 +109,10 @@ var Pers_gen = {
var most_recent_color = "white"; // none
var most_recent_end = 0;
var results = server_result_list[i];
+ var servername = results.server.replace(/^https?\:\/\//, '');
y_cord += 20;
res += '<text x="4" y="' + (y_cord + 8) + '" font-size="10">'
- + results.server + '</text>\n';
+ + servername + '</text>\n';
for(var j = 0; j < results.obs.length; j++) {
var obs = results.obs[j];
diff --git a/plugin/chrome/content/notaries.js b/plugin/chrome/content/notaries.js
index a1d9951..4f493f2 100644
--- a/plugin/chrome/content/notaries.js
+++ b/plugin/chrome/content/notaries.js
@@ -273,8 +273,13 @@ var Perspectives = {
querySingleNotary: function(notary_server, ti) {
var port = (ti.uri.port == -1) ? 443 : ti.uri.port;
- var full_url = "http://" + notary_server.host +
+ var full_url = notary_server.host +
"?host=" + ti.uri.host + "&port=" + port + "&service_type=2&";
+ if (full_url.substring(0,4) !== 'http') {
+ // default to unencrypted queries if nothing is specified,
+ // since we don't know if the server supports HTTPS.
+ full_url = "http://" + full_url;
+ }
Pers_debug.d_print("query", "sending query: '" + full_url + "'");
var req = new XMLHttpRequest();
req.open("GET", full_url, true);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/perspectives-extension.git
More information about the Pkg-mozext-commits
mailing list