From 9dd29f6048525481a761a80a60c2da6b60e8a734 Mon Sep 17 00:00:00 2001 From: Nathan Kinsinger Date: Tue, 16 Nov 2010 20:17:48 -0700 Subject: [PATCH] Fix creating Gists GitHub changed their site to use SSL. On error GitHub may return the "All Gists" page which will have several "gist: #", so check for the edit link instead. --- html/views/history/history.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/html/views/history/history.js b/html/views/history/history.js index c0ac4c6..225e590 100644 --- a/html/views/history/history.js +++ b/html/views/history/history.js @@ -107,7 +107,7 @@ var gistie = function() { var t = new XMLHttpRequest(); t.onreadystatechange = function() { if (t.readyState == 4 && t.status >= 200 && t.status < 300) { - if (m = t.responseText.match(/gist: ([a-f0-9]+)/)) + if (m = t.responseText.match(//)) notify("Code uploaded to gistie #" + m[1] + "", 1); else { notify("Pasting to Gistie failed :(.", -1); @@ -116,7 +116,7 @@ var gistie = function() { } } - t.open('POST', "http://gist.github.com/gists"); + t.open('POST', "https://gist.github.com/gists"); t.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); t.setRequestHeader('Accept', 'text/javascript, text/html, application/xml, text/xml, */*'); t.setRequestHeader('Content-type', 'application/x-www-form-urlencoded;charset=UTF-8');