jenkins-bot has submitted this change and it was merged.
Change subject: Only set cookie header on API requests when one was passed in
......................................................................
Only set cookie header on API requests when one was passed in
We don't send Vary: Cookie headers ourselves, but it seems to be well possible
that our Varnish config (by using various MW defaults) varies on cookies by
default. That would explain the cache misses on selser that we are seeing in
production.
Change-Id: Id28070fce871c51b80a9c443cf4bdd790e903449
---
M js/lib/mediawiki.ApiRequest.js
1 file changed, 5 insertions(+), 1 deletion(-)
Approvals:
Catrope: Looks good to me, but someone else must approve
GWicke: Looks good to me, approved
jenkins-bot: Verified
diff --git a/js/lib/mediawiki.ApiRequest.js b/js/lib/mediawiki.ApiRequest.js
index 8ac266b..676e0c5 100644
--- a/js/lib/mediawiki.ApiRequest.js
+++ b/js/lib/mediawiki.ApiRequest.js
@@ -560,12 +560,16 @@
timeout: 60 * 1000, // 60 seconds: less than 100s VE timeout so
we still finish
headers: {
'User-Agent': userAgent,
- 'Cookie': env.cookie,
'Connection': 'close',
'x-parsoid-request': 'cache'
}
};
+ if (env.cookie) {
+ // Forward the cookie if set
+ this.requestOptions.headers.Cookie = env.cookie;
+ }
+
if (!options.evenIfNotCached) {
// Request a reply only from cache.
this.requestOptions.headers['Cache-control'] = 'only-if-cached';
--
To view, visit https://gerrit.wikimedia.org/r/94308
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Id28070fce871c51b80a9c443cf4bdd790e903449
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: GWicke <[email protected]>
Gerrit-Reviewer: Arlolra <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: GWicke <[email protected]>
Gerrit-Reviewer: Subramanya Sastry <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits