Jelajahi Sumber

Merge pull request #3849 from pfischermx/master

Send OpenTSDB POST request as urlencoded
Torkel Ödegaard 10 tahun lalu
induk
melakukan
a985f21d44
1 mengubah file dengan 3 tambahan dan 0 penghapusan
  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);
     };