diff --git a/zeppelin-web/src/app/app.js b/zeppelin-web/src/app/app.js index d83fa98ae0a..111cca2af0a 100644 --- a/zeppelin-web/src/app/app.js +++ b/zeppelin-web/src/app/app.js @@ -146,8 +146,10 @@ let zeppelinWebApp = angular.module('zeppelinWebApp', requiredModules) }) // handel logout on API failure - .config(function ($httpProvider, $provide) { - $httpProvider.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest' + .config(function ($httpProvider, $provide) { + if (process.env.PROD) { + $httpProvider.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest' + } $provide.factory('httpInterceptor', function ($q, $rootScope) { return { 'responseError': function (rejection) { @@ -177,7 +179,7 @@ function auth () { }, crossDomain: true }) - let config = {headers: { 'X-Requested-With': 'XMLHttpRequest' }} + let config = (process.env.PROD) ? {headers: { 'X-Requested-With': 'XMLHttpRequest' }} : {} return $http.get(baseUrlSrv.getRestApiBase() + '/security/ticket', config).then(function (response) { zeppelinWebApp.run(function ($rootScope) { $rootScope.ticket = angular.fromJson(response.data).body diff --git a/zeppelin-web/webpack.config.js b/zeppelin-web/webpack.config.js index 88c7acca1bc..5c2e1dfa2fa 100644 --- a/zeppelin-web/webpack.config.js +++ b/zeppelin-web/webpack.config.js @@ -236,6 +236,7 @@ module.exports = function makeWebpackConfig () { HELIUM_BUNDLE_DEV: process.env.HELIUM_BUNDLE_DEV, SERVER_PORT: serverPort, WEB_PORT: webPort, + PROD: isProd, BUILD_CI: (isCI) ? JSON.stringify(true) : JSON.stringify(false) } })