Set the response to 403 on error

This commit is contained in:
Simon Welsh 2014-03-15 20:58:47 +13:00
parent 5beaebc43a
commit bdd936d078

View File

@ -1235,6 +1235,7 @@ class UploadField extends FileField {
// Format response with json
$response = new SS_HTTPResponse(Convert::raw2json(array($return)));
$response->addHeader('Content-Type', 'text/plain');
if (!empty($return['error'])) $response->setStatusCode(403);
return $response;
}