Alex Monk has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/196503

Change subject: Don't try to access x-parsoid-performance on restbase cache hits
......................................................................

Don't try to access x-parsoid-performance on restbase cache hits

It doesn't get set

Change-Id: I6695ab0e7d461b7541dd56e392f8d1479998f2b5
---
M ApiVisualEditor.php
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/03/196503/1

diff --git a/ApiVisualEditor.php b/ApiVisualEditor.php
index acd92ea..2ec1dae 100644
--- a/ApiVisualEditor.php
+++ b/ApiVisualEditor.php
@@ -94,9 +94,10 @@
                        // served directly from Varnish, in  which case discard 
the value of the XPP header
                        // and use it to declare the cache hit instead.
                        $headers = $response['headers'];
+                       $xpp = null;
                        if ( isset( $headers['x-cache'] ) && strpos( 
$headers['x-cache'], 'hit' ) !== false ) {
                                $xpp = 'cached-response=true';
-                       } else {
+                       } elseif ( isset( $headers['x-parsoid-performance'] ) ) 
{
                                $xpp = $headers['x-parsoid-performance'];
                        }
                        if ( $xpp !== null ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/196503
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6695ab0e7d461b7541dd56e392f8d1479998f2b5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Alex Monk <kren...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to