This is an automated email from the ASF dual-hosted git repository.
vnick pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/guacamole-client.git
The following commit(s) were added to refs/heads/master by this push:
new 65995e3 GUACAMOLE-783: Ensure GET requests to the REST API are not
serviced from the cache in Internet Explorer.
new 95f10f5 GUACAMOLE-783: Merge ensure GET requests to REST API are not
cached in IE.
65995e3 is described below
commit 65995e3f5afa97aeae9caec4c23c328b2e3a6ee3
Author: Michael Jumper <[email protected]>
AuthorDate: Sat Apr 27 14:59:44 2019 -0700
GUACAMOLE-783: Ensure GET requests to the REST API are not serviced from
the cache in Internet Explorer.
IE 11 appears to ignore the `Cache-Control` header on requests despite
RFC 7234 and does not invalidate cache after changes are made to a
resource via PUT/DELETE/POST despite RFC 2616. It _does_ behave
correctly when the `Pragma` header is included.
This behavior is not observed for Chrome/Firefox which both correctly
honor the `Cache-Control` header and correctly invalidate cache after
changes.
---
.../{indexHttpPatchConfig.js => httpDefaults.js} | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
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 114d598..9de1ce2 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) {
-
- $httpProvider.defaults.headers.patch = {
- 'Content-Type': 'application/json'
- }
-}]);
+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'
+ };
+
+}]);