[Bug 40032] code 415 for bad type in action=raw
authordaniel <daniel.kinzler@wikimedia.de>
Tue, 9 Oct 2012 12:00:00 +0000 (14:00 +0200)
committerGerrit Code Review <gerrit@wikimedia.org>
Sun, 14 Oct 2012 23:35:52 +0000 (23:35 +0000)
Non-text content is not supported via action=raw. Use code 415 instead
of 406 to indicate this.

Change-Id: I6b7fbc5f4d0040ca2c90b77b2ceb39853f136fd8

includes/actions/RawAction.php

index 7e7784c..ec3d60a 100644 (file)
@@ -151,8 +151,8 @@ class RawAction extends FormlessAction {
                                $content = $rev->getContent();
 
                                if ( !$content instanceof TextContent ) {
-                                       wfHttpError( 406, "Not Acceptable", "The requested page uses the content model `"
-                                                                                                               . $content->getModel() . "` which is not supported via this interface." );
+                                       wfHttpError( 415, "Unsupported Media Type", "The requested page uses the content model `"
+                                                                               . $content->getModel() . "` which is not supported via this interface." );
                                        die();
                                }