From 99b5ec11aca481326c5052f512da03e8d11aca3d Mon Sep 17 00:00:00 2001 From: Ryan McCue Date: Tue, 19 Apr 2016 15:05:37 +1000 Subject: [PATCH 1/2] Uppercase the method to ensure compatibility --- library/Requests.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/Requests.php b/library/Requests.php index 4c7e93217..4122ac473 100755 --- a/library/Requests.php +++ b/library/Requests.php @@ -572,6 +572,9 @@ protected static function set_defaults(&$url, &$headers, &$data, &$type, &$optio $options['data_format'] = 'body'; } } + + // Massage the type to ensure we support it. + $type = strtoupper($type); } /** From 0158da50f69091c2a28e013b1a5a1a8e47c5dab4 Mon Sep 17 00:00:00 2001 From: Ryan McCue Date: Tue, 19 Apr 2016 15:25:43 +1000 Subject: [PATCH 2/2] Move $type adjustments to before we check it --- library/Requests.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/Requests.php b/library/Requests.php index 4122ac473..4ec11cb7d 100755 --- a/library/Requests.php +++ b/library/Requests.php @@ -564,6 +564,9 @@ protected static function set_defaults(&$url, &$headers, &$data, &$type, &$optio $url = $iri->uri; } + // Massage the type to ensure we support it. + $type = strtoupper($type); + if (!isset($options['data_format'])) { if (in_array($type, array(self::HEAD, self::GET, self::DELETE))) { $options['data_format'] = 'query'; @@ -572,9 +575,6 @@ protected static function set_defaults(&$url, &$headers, &$data, &$type, &$optio $options['data_format'] = 'body'; } } - - // Massage the type to ensure we support it. - $type = strtoupper($type); } /**