Commit c140c8ca by bret barker

fix #1204: add separate datasource parameter withCredentials

parent 1591a486
...@@ -24,6 +24,7 @@ function (angular, _, $, config, kbn, moment) { ...@@ -24,6 +24,7 @@ function (angular, _, $, config, kbn, moment) {
this.supportMetrics = true; this.supportMetrics = true;
this.annotationEditorSrc = 'app/partials/graphite/annotation_editor.html'; this.annotationEditorSrc = 'app/partials/graphite/annotation_editor.html';
this.cacheTimeout = datasource.cacheTimeout; this.cacheTimeout = datasource.cacheTimeout;
this.withCredentials = datasource.withCredentials;
} }
GraphiteDatasource.prototype.query = function(options) { GraphiteDatasource.prototype.query = function(options) {
...@@ -209,8 +210,10 @@ function (angular, _, $, config, kbn, moment) { ...@@ -209,8 +210,10 @@ function (angular, _, $, config, kbn, moment) {
}; };
GraphiteDatasource.prototype.doGraphiteRequest = function(options) { GraphiteDatasource.prototype.doGraphiteRequest = function(options) {
if (this.basicAuth) { if (this.basicAuth || this.withCredentials) {
options.withCredentials = true; options.withCredentials = true;
}
if (this.basicAuth) {
options.headers = options.headers || {}; options.headers = options.headers || {};
options.headers.Authorization = 'Basic ' + this.basicAuth; options.headers.Authorization = 'Basic ' + this.basicAuth;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment