From 63358dff31f8ecdd9eb00a61de1122123ff6f1d7 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Tue, 13 Oct 2015 00:31:22 -0400 Subject: Issue #2350033 by murrayw, kenorb: drupal_http_request thinks 201 through 206 status codes are an error --- CHANGELOG.txt | 2 ++ includes/common.inc | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 6101a1e3c..f23b9c993 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,8 @@ Drupal 7.40, xxxx-xx-xx (development version) ----------------------- +- Prevented drupal_http_request() from returning an error when it receives a + 201 through 206 HTTP status code. - Added support for autoloading traits via the registry on sites running PHP 5.4 or higher. - Allowed the user-picture.tpl.php theme template to have HTML classes besides diff --git a/includes/common.inc b/includes/common.inc index bf187dbb9..ab763bad7 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -1057,6 +1057,12 @@ function drupal_http_request($url, array $options = array()) { switch ($code) { case 200: // OK + case 201: // Created + case 202: // Accepted + case 203: // Non-Authoritative Information + case 204: // No Content + case 205: // Reset Content + case 206: // Partial Content case 304: // Not modified break; case 301: // Moved permanently -- cgit v1.2.3