فهرست منبع

If OpenTSDB is 3rd-party hosted (or by another team) and does not support OPTIONS, send the request as POST (urlencoded)

Pablo Fischer 10 سال پیش
والد
کامیت
29185eeef7
1فایلهای تغییر یافته به همراه3 افزوده شده و 0 حذف شده
  1. 3 0
      public/app/plugins/datasource/opentsdb/datasource.js

+ 3 - 0
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);
     };