Skip to content

Commit 9dd29f6

Browse files
committed
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.
1 parent b41da9e commit 9dd29f6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

html/views/history/history.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ var gistie = function() {
107107
var t = new XMLHttpRequest();
108108
t.onreadystatechange = function() {
109109
if (t.readyState == 4 && t.status >= 200 && t.status < 300) {
110-
if (m = t.responseText.match(/gist: ([a-f0-9]+)/))
110+
if (m = t.responseText.match(/<a href="\/gists\/([a-f0-9]+)\/edit">/))
111111
notify("Code uploaded to gistie <a target='_new' href='http://gist.github.com/" + m[1] + "'>#" + m[1] + "</a>", 1);
112112
else {
113113
notify("Pasting to Gistie failed :(.", -1);
@@ -116,7 +116,7 @@ var gistie = function() {
116116
}
117117
}
118118

119-
t.open('POST', "http://gist.github.com/gists");
119+
t.open('POST', "https://gist.github.com/gists");
120120
t.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
121121
t.setRequestHeader('Accept', 'text/javascript, text/html, application/xml, text/xml, */*');
122122
t.setRequestHeader('Content-type', 'application/x-www-form-urlencoded;charset=UTF-8');

0 commit comments

Comments
 (0)