746201ed49
Adds xhr connection managment to http/1.1 installs This includes various things: 1. An object pool to 'acquire', 'release' and 'dispose' of objects, also a 'purge' to completely empty it 2. A `Request` data object, mainly for reasoning about the object better 3. A pseudo http 'client' which doens't actually control the request itself but does help to manage the connections An initializer is used to detect the script element of the consul-ui sourcecode which we use later to sniff the protocol that we are most likely using for API access
16 lines
351 B
JavaScript
16 lines
351 B
JavaScript
const scripts = document.getElementsByTagName('script');
|
|
const current = scripts[scripts.length - 1];
|
|
|
|
export function initialize(application) {
|
|
const Client = application.resolveRegistration('service:client/http');
|
|
Client.reopen({
|
|
isCurrent: function(src) {
|
|
return current.src === src;
|
|
},
|
|
});
|
|
}
|
|
|
|
export default {
|
|
initialize,
|
|
};
|