You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The first time the XMLHttpRequest#open(method, url, async, username, password) is called it creates a RequestContext object which is stored inside a cache.
XMLHttpRequest.prototype.open=function(){// Creates a RequestContext object for the requestvarrequestContext=OAuth.RequestContext.create(this,arguments);// Stores the RequestContext object in the RequestContext cache This.addRequestContext(requestContext);// Calls the OAuth.JS overwritten 'open' methodreturnThis._open(requestContext);};
The in the overwritten send and setRequestHeader methods we get the RequestObject back.
XMLHttpRequest.prototype.setRequestHeader=function(key,value){// Gets the RequestContext associated to this original XMLHttpRequest object from the RequestContext cache varrequestContext=This.getRequestContext(this.getId());
...
};
For now the cache is managed directly in the AbstractRequestManager, to have something easy to test and update we should create a new dedicated RequestContextCache component.
Be careful in the implementation, the RequestContext objects associated to already used xhrs should be evicted to free memory.
The text was updated successfully, but these errors were encountered:
When a Request Manager starts it overwrites 3 methods of
XMLHttpRequest
👍XMLHttpRequest#open(method, url, async, username, password)
XMLHttpRequest#send(data)
XMLHttpRequest#setRequestHeader(name, value)
The first time the
XMLHttpRequest#open(method, url, async, username, password)
is called it creates aRequestContext
object which is stored inside a cache.The in the overwritten
send
andsetRequestHeader
methods we get theRequestObject
back.For now the cache is managed directly in the
AbstractRequestManager
, to have something easy to test and update we should create a new dedicatedRequestContextCache
component.Be careful in the implementation, the
RequestContext
objects associated to already used xhrs should be evicted to free memory.The text was updated successfully, but these errors were encountered: