Aaron Schulz has uploaded a new change for review.

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

Change subject: Make Swift backend respect Content-Type in create/store
......................................................................

Make Swift backend respect Content-Type in create/store

Change-Id: I479d1fc4f261bdcdc380404db0cb2f2397877759
---
M includes/filebackend/SwiftFileBackend.php
1 file changed, 6 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/30/248930/1

diff --git a/includes/filebackend/SwiftFileBackend.php 
b/includes/filebackend/SwiftFileBackend.php
index e72d026..83c1da1 100644
--- a/includes/filebackend/SwiftFileBackend.php
+++ b/includes/filebackend/SwiftFileBackend.php
@@ -262,7 +262,9 @@
                }
 
                $sha1Hash = wfBaseConvert( sha1( $params['content'] ), 16, 36, 
31 );
-               $contentType = $this->getContentType( $params['dst'], 
$params['content'], null );
+               $contentType = isset( $params['headers']['content-type'] )
+                       ? $params['headers']['content-type']
+                       : $this->getContentType( $params['dst'], 
$params['content'], null );
 
                $reqs = array( array(
                        'method' => 'PUT',
@@ -318,7 +320,9 @@
                        return $status;
                }
                $sha1Hash = wfBaseConvert( $sha1Hash, 16, 36, 31 );
-               $contentType = $this->getContentType( $params['dst'], null, 
$params['src'] );
+               $contentType = isset( $params['headers']['content-type'] )
+                       ? $params['headers']['content-type']
+                       : $this->getContentType( $params['dst'], null, 
$params['src'] );
 
                $handle = fopen( $params['src'], 'rb' );
                if ( $handle === false ) { // source doesn't exist?

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I479d1fc4f261bdcdc380404db0cb2f2397877759
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to