From 29185eeef78f54e59cf2a91b6bed0017a9c87edd Mon Sep 17 00:00:00 2001 From: Pablo Fischer Date: Tue, 26 Jan 2016 00:12:56 +0000 Subject: [PATCH] If OpenTSDB is 3rd-party hosted (or by another team) and does not support OPTIONS, send the request as POST (urlencoded) --- public/app/plugins/datasource/opentsdb/datasource.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/public/app/plugins/datasource/opentsdb/datasource.js b/public/app/plugins/datasource/opentsdb/datasource.js index d7cc354861f..f4680038e8d 100644 --- a/public/app/plugins/datasource/opentsdb/datasource.js +++ b/public/app/plugins/datasource/opentsdb/datasource.js @@ -72,6 +72,9 @@ function (angular, _, dateMath) { data: reqBody }; + // In case the backend is 3rd-party hosted and does not suport OPTIONS, urlencoded requests + // go as POST rather than OPTIONS+POST + options.headers = { 'Content-Type': 'application/x-www-form-urlencoded' }; return backendSrv.datasourceRequest(options); };