We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f3ca213 + 2d1c754 commit 7fc0ca0Copy full SHA for 7fc0ca0
1 file changed
github.js
@@ -45,7 +45,7 @@
45
}
46
47
var xhr = new XMLHttpRequest();
48
- if (!raw) {xhr.dataType = "json";}
+
49
50
xhr.open(method, getURL(), !sync);
51
if (!sync) {
@@ -59,7 +59,14 @@
59
60
};
61
62
- xhr.setRequestHeader('Accept','application/vnd.github.v3.raw+json');
63
+ if (!raw) {
64
+ xhr.dataType = "json";
65
+ xhr.setRequestHeader('Accept','application/vnd.github.v3+json');
66
+ } else {
67
+ xhr.setRequestHeader('Accept','application/vnd.github.v3.raw+json');
68
+ }
69
70
xhr.setRequestHeader('Content-Type','application/json;charset=UTF-8');
71
if ((options.token) || (options.username && options.password)) {
72
var authorization = options.token ? 'token ' + options.token : 'Basic ' + btoa(options.username + ':' + options.password);
0 commit comments