mike-jumper commented on code in PR #832:
URL: https://github.com/apache/guacamole-client/pull/832#discussion_r1169011673


##########
guacamole/src/main/frontend/src/app/rest/services/tunnelService.js:
##########
@@ -96,20 +96,18 @@ angular.module('rest').factory('tunnelService', 
['$injector',
      *     success.
      */
     service.getProtocol = function getProtocol(tunnel) {
-
-        // Build HTTP parameters set
-        var httpParameters = {
-            token : authenticationService.getCurrentToken()
-        };
-
+        // GUACAMOLE-956: replace http parameter with header | START
         // Retrieve the protocol details of the specified tunnel
         return requestService({
             method  : 'GET',
             url     : 'api/session/tunnels/' + encodeURIComponent(tunnel)
                         + '/protocol',
-            params  : httpParameters
-        });
+            headers: {
+                'Guacamole-Token': authenticationService.getCurrentToken(),
+            }
 
+        });
+        // GUACAMOLE-956: replace http parameter with header | END

Review Comment:
   Please don't bracket your changes in start/end comments noting the JIRA 
issue. It's better that the changes be just the changes themselves, plus any 
necessary documentation.



##########
guacamole/src/main/frontend/src/app/rest/services/tunnelService.js:
##########
@@ -96,20 +96,18 @@ angular.module('rest').factory('tunnelService', 
['$injector',
      *     success.
      */
     service.getProtocol = function getProtocol(tunnel) {
-
-        // Build HTTP parameters set
-        var httpParameters = {
-            token : authenticationService.getCurrentToken()
-        };
-
+        // GUACAMOLE-956: replace http parameter with header | START
         // Retrieve the protocol details of the specified tunnel
         return requestService({
             method  : 'GET',
             url     : 'api/session/tunnels/' + encodeURIComponent(tunnel)
                         + '/protocol',
-            params  : httpParameters
-        });
+            headers: {
+                'Guacamole-Token': authenticationService.getCurrentToken(),
+            }

Review Comment:
   Instead of manually including the `Guacamole-Token` header, it would be 
better to call `authenticationService.request()` which adds the header 
automatically. For example:
   
   
https://github.com/apache/guacamole-client/blob/d9bb38eb65dd7e2f5fd1b13fa108d9d19c7cab4a/guacamole/src/main/frontend/src/app/rest/services/tunnelService.js#L78-L81



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@guacamole.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to