mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
Merge pull request #130 from clintongormley/master
Add a "raw" header to the AJAX request when ?load_from points to GitHub API
This commit is contained in:
commit
81d07e0eb2
1 changed files with 8 additions and 4 deletions
|
@ -121,9 +121,13 @@ define([
|
|||
input.autoIndent();
|
||||
}
|
||||
}
|
||||
else if (/^https?:\/\//.exec(sourceLocation)) {
|
||||
$.get(sourceLocation, null, function (data) {
|
||||
resetToValues(null, data);
|
||||
else if (/^https?:\/\//.test(sourceLocation)) {
|
||||
var loadFrom = { url: sourceLocation , dataType: "text" };
|
||||
if (/https?:\/\/api.github.com/.test(sourceLocation)) {
|
||||
loadFrom.headers = { Accept: "application/vnd.github.v3.raw" };
|
||||
}
|
||||
$.ajax(loadFrom).done( function (data) {
|
||||
resetToValues(defaultHost, data);
|
||||
input.highlightCurrentRequestAndUpdateActionBar();
|
||||
input.updateActionsBar();
|
||||
});
|
||||
|
@ -131,7 +135,7 @@ define([
|
|||
else if (previousSaveState) {
|
||||
resetToValues(previousSaveState.server);
|
||||
} else {
|
||||
resetToValues(defaultHost)
|
||||
resetToValues(defaultHost);
|
||||
}
|
||||
|
||||
}());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue