New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EZP-25409: Make CAPI site access aware #75
Conversation
@@ -69,6 +71,10 @@ define(["structures/Response", "structures/Request", "structures/CAPIError"], | |||
} | |||
} | |||
|
|||
if (null !== this._siteAccess) { | |||
headers = extend({}, headers, {'X-Siteaccess': this._siteAccess}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems quite complicated, can't you just write ?
headers['X-Siteaccess'] = this._siteAcess;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also the same operation has to be done in notAuthorizedRequest
method below
@wizhippo up for it? :) |
@@ -11,11 +11,13 @@ define(["structures/Response", "structures/Request", "structures/CAPIError"], | |||
* @param endPointUrl {String} url to REST root | |||
* @param authenticationAgent {object} Instance of one of the AuthAgents (e.g. SessionAuthAgent, HttpBasicAuthAgent) | |||
* @param connectionFactory {ConnectionFeatureFactory} the factory which is choosing compatible connection from connections list | |||
* @param siteAccess {String|Null} SiteAccess to use for requests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should mark the parameter as optional ie
@param [siteAccess] {String} SiteAccess to use for requests
besides the last 2 inline comments, +1 |
@dpobel thanks for the review |
+1 |
1 similar comment
+1 |
EZP-25409: Make CAPI site access aware
https://jira.ez.no/browse/EZP-25409
This allows the siteacces to be passed as an option to CAPI