Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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.
  • Loading branch information...
commit 9dd29f6048525481a761a80a60c2da6b60e8a734 1 parent b41da9e
Nathan Kinsinger brotherbard authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 html/views/history/history.js
4 html/views/history/history.js
View
@@ -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(/<a href="\/gists\/([a-f0-9]+)\/edit">/))
notify("Code uploaded to gistie <a target='_new' href='http://gist.github.com/" + m[1] + "'>#" + m[1] + "</a>", 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');
Please sign in to comment.
Something went wrong with that request. Please try again.