Set CSP instead of frameAncestors

This commit is contained in:
Girish Ramakrishnan
2019-10-14 16:50:15 -07:00
parent 13c3624025
commit a641fec3ae
2 changed files with 8 additions and 11 deletions
+4 -7
View File
@@ -494,24 +494,21 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
success: false,
robotsTxt: '',
frameAncestors: '',
csp: '',
show: function () {
$scope.security.error = {};
$scope.security.robotsTxt = $scope.app.reverseProxyConfig.robotsTxt || '';
$scope.security.frameAncestors = ($scope.app.reverseProxyConfig.frameAncestors || []).join(' ');
$scope.security.csp = $scope.app.reverseProxyConfig.csp || '';
},
submit: function () {
$scope.security.busy = true;
$scope.security.error = {};
var fa = $scope.security.frameAncestors.split(' ').map(function (t) { return t.trim(); }).filter(function (t) { return !!t; });
var reverseProxyConfig = {
robotsTxt: $scope.security.robotsTxt,
frameAncestors: fa,
hideHeaders: []
robotsTxt: $scope.security.robotsTxt || null, // empty string resets
csp: $scope.security.csp || null // empty string resets
};
Client.configureApp($scope.app.id, 'reverse_proxy', reverseProxyConfig, function (error) {