File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 4545 }
4646
4747 var xhr = new XMLHttpRequest ( ) ;
48- if ( ! raw ) { xhr . dataType = "json" ; }
48+
4949
5050 xhr . open ( method , getURL ( ) , ! sync ) ;
5151 if ( ! sync ) {
5959 }
6060 } ;
6161 }
62- xhr . setRequestHeader ( 'Accept' , 'application/vnd.github.v3.raw+json' ) ;
62+
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+
6370 xhr . setRequestHeader ( 'Content-Type' , 'application/json;charset=UTF-8' ) ;
6471 if ( ( options . token ) || ( options . username && options . password ) ) {
6572 var authorization = options . token ? 'token ' + options . token : 'Basic ' + btoa ( options . username + ':' + options . password ) ;
You can’t perform that action at this time.
0 commit comments