I have a simple HTTP post call in an angular controller that works fine when I run it on my local host, but gets a 403 error when it is deployed to a stage server. More specifically it only gets the 403 error on Chrome, it works fine on IE and FireFox.
Here is the JS file:
var app = angular.module('app', ['ngAnimate', 'ui.bootstrap'], function($locationProvider) {
$locationProvider.html5Mode({
enabled: true,
requireBase: false
});
});
app.controller('ClearFilesController', ['$rootScope', '$timeout', '$scope', '$http', '$uibModal', '$filter','$window','$location',function($rootScope, $timeout, $scope, $http, $uibModal, $filter,$window,$location) {
$scope.message = "Clear Test Files";
$scope.statusMessage = "Click the button to delete test files in the 'Automation Testing' Collection";
$scope.deleteFiles = function(){
$scope.statusMessage = "Clearing files...";
$http.post('/clearFiles')
.then(function(response){
var status = response.status;
if('200'!=status) {
$scope.statusMessage = "Clearing of files failed.";
} else {
$scope.statusMessage = "Successfully cleared files.";
}
});
};
}]);
Here is the error from the dev tools on Chrome: angular.js:11630 POST https://sample-stageserver.com/clearFiles/ 403 (Forbidden)
What would be a possible reason why I am only getting this error in Chrome?