From 768f624834a31f2fe87e45311991665b299568f0 Mon Sep 17 00:00:00 2001 From: Pouyan Heyratpour Date: Mon, 9 Oct 2017 17:02:41 +0330 Subject: [PATCH] Let change $http config from api function call - This is used for overriding/defining request headers like Authorization in Basic-Authentication Signed-off-by: Pouyan Heyratpour --- dist/angular-swagger2-client.js | 4 ++-- dist/angular-swagger2-client.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/angular-swagger2-client.js b/dist/angular-swagger2-client.js index deec5dd..25ef75a 100644 --- a/dist/angular-swagger2-client.js +++ b/dist/angular-swagger2-client.js @@ -416,12 +416,12 @@ * @todo Check format * */ }); - var httpConfig = { + var httpConfig = angular.extend({ url: this.host + finalResponse.uri, method: method, data: swaggerRequest.data.formData, headers: swaggerRequest.data.headers - }; + }, swaggerRequest.config); // prepare promise var defered = $q.defer(); var promise = defered.promise; diff --git a/dist/angular-swagger2-client.ts b/dist/angular-swagger2-client.ts index 4f56218..50a685b 100644 --- a/dist/angular-swagger2-client.ts +++ b/dist/angular-swagger2-client.ts @@ -438,12 +438,12 @@ * @todo Check format * */ }); - let httpConfig = { + let httpConfig = angular.extend({ url : this.host + finalResponse.uri, method : method, data : swaggerRequest.data.formData, headers : swaggerRequest.data.headers - }; + }, swaggerRequest.config); // prepare promise let defered = $q.defer ();