Просмотр исходного кода

[Http] Automatically populate enctype for options request

Eric GELOEN 11 лет назад
Родитель
Сommit
5fed1ab58c
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      library/Zend/Http/Client.php

+ 3 - 3
library/Zend/Http/Client.php

@@ -391,8 +391,8 @@ class Zend_Http_Client
             throw new Zend_Http_Client_Exception("'{$method}' is not a valid HTTP request method.");
         }
 
-        if (($method == self::POST || $method == self::PUT || $method == self::DELETE || $method == self::PATCH)
-             && $this->enctype === null) {
+        if (($method == self::POST || $method == self::PUT || $method == self::DELETE || $method == self::PATCH
+             || $method == self::OPTIONS) && $this->enctype === null) {
             $this->setEncType(self::ENC_URLENCODED);
         }
 
@@ -761,7 +761,7 @@ class Zend_Http_Client
             'ctype'    => $ctype,
             'data'     => $data
         );
-        
+
         $this->body_field_order[$formname] = self::VTYPE_FILE;
 
         return $this;