From f357f4c9d75fae5ebf40729b9bfdb74e80733e9b Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 1 Jun 2015 14:24:09 +0800 Subject: [PATCH] fix default header --- .../src/main/resources/php/APIClient.mustache | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/php/APIClient.mustache b/modules/swagger-codegen/src/main/resources/php/APIClient.mustache index aa85a2b1a37..cbde8987da9 100644 --- a/modules/swagger-codegen/src/main/resources/php/APIClient.mustache +++ b/modules/swagger-codegen/src/main/resources/php/APIClient.mustache @@ -182,13 +182,10 @@ class APIClient { $this->updateParamsForAuth($headerParams, $queryParams, $authSettings); # construct the http header - if ($headerParams !== null) { - # add default header - $headerParams = array_merge((array)self::$default_header, $headerParams); + $headerParams = array_merge((array)self::$default_header, (array)$headerParams); - foreach ($headerParams as $key => $val) { - $headers[] = "$key: $val"; - } + foreach ($headerParams as $key => $val) { + $headers[] = "$key: $val"; } // form data