diff --git a/guacamole/src/main/webapp/app/index/config/indexHttpPatchConfig.js b/guacamole/src/main/webapp/app/index/config/httpDefaults.js similarity index 67% rename from guacamole/src/main/webapp/app/index/config/indexHttpPatchConfig.js rename to guacamole/src/main/webapp/app/index/config/httpDefaults.js index 114d59882..9de1ce22b 100644 --- a/guacamole/src/main/webapp/app/index/config/indexHttpPatchConfig.js +++ b/guacamole/src/main/webapp/app/index/config/httpDefaults.js @@ -18,14 +18,19 @@ */ /** - * The config block for setting up the HTTP PATCH method. + * Defaults for the AngularJS $http service. */ -angular.module('index').config(['$httpProvider', - function indexHttpPatchConfig($httpProvider) { - +angular.module('index').config(['$httpProvider', function httpDefaults($httpProvider) { + + // Do not cache the responses of GET requests + $httpProvider.defaults.headers.get = { + 'Cache-Control' : 'no-cache', + 'Pragma' : 'no-cache' + }; + + // Use "application/json" content type by default for PATCH requests $httpProvider.defaults.headers.patch = { - 'Content-Type': 'application/json' - } + 'Content-Type' : 'application/json' + }; + }]); - -