Github user mike-jumper commented on a diff in the pull request:
https://github.com/apache/incubator-guacamole-client/pull/210#discussion_r151607411
--- Diff: guacamole-common-js/src/main/webapp/modules/Tunnel.js ---
@@ -215,6 +215,24 @@ Guacamole.HTTPTunnel = function(tunnelURL,
crossDomain) {
var receive_timeout = null;
/**
+ * Additional headers to be sent in tunnel requests. This dictionary
can be
+ * populated with key/value header pairs to pass information such as
authentication
+ * tokens, etc.
+ */
+ var extraHeaders = {};
--- End diff --
1. Declaring this via `var` produces a private variable, accessible only
within the scope of this constructor. The `add_extra_headers()` function you've
written will still work, but it's not accessing the `extraHeaders` declared
here. If using this approach, `extraHeaders` will need to be defined as:
this.extraHeaders = {};
2. Why not an optional parameter to the constructor, similar to
`crossDomain`, rather than a public property?
---