From 6e7c034901586680b52c21f0cdb1e9988b4716c5 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 22 Jul 2015 13:19:12 -0700 Subject: [PATCH] Improved addMissingMetadata() on POST failure * If the POST failed but the sha1 was computed, then use and cache that value rather than "false". Change-Id: I42b53c823013ecd9b281406e3d533a21e0de7cfb --- includes/filebackend/SwiftFileBackend.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/includes/filebackend/SwiftFileBackend.php b/includes/filebackend/SwiftFileBackend.php index 2ccafe4b1d..e9df2054f9 100644 --- a/includes/filebackend/SwiftFileBackend.php +++ b/includes/filebackend/SwiftFileBackend.php @@ -670,10 +670,10 @@ class SwiftFileBackend extends FileBackendStore { $ps = Profiler::instance()->scopedProfileIn( __METHOD__ . "-{$this->name}" ); wfDebugLog( 'SwiftBackend', __METHOD__ . ": $path was not stored with SHA-1 metadata." ); + $objHdrs['x-object-meta-sha1base36'] = false; + $auth = $this->getAuthentication(); if ( !$auth ) { - $objHdrs['x-object-meta-sha1base36'] = false; - return $objHdrs; // failed } @@ -700,7 +700,6 @@ class SwiftFileBackend extends FileBackendStore { } wfDebugLog( 'SwiftBackend', __METHOD__ . ": unable to set SHA-1 metadata for $path" ); - $objHdrs['x-object-meta-sha1base36'] = false; return $objHdrs; // failed } -- 2.20.1