From 1b7a6b9ed80912c44d705f7e0bed0d7dd20cac70 Mon Sep 17 00:00:00 2001 From: Ichai Luzon Date: Thu, 18 Apr 2024 19:09:00 +0300 Subject: [PATCH] Allow using Accept header passed as parameter --- .../handlebars/typescript-angular/api.service.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/handlebars/typescript-angular/api.service.mustache b/src/main/resources/handlebars/typescript-angular/api.service.mustache index 167ddf80fb..457b5a5a20 100644 --- a/src/main/resources/handlebars/typescript-angular/api.service.mustache +++ b/src/main/resources/handlebars/typescript-angular/api.service.mustache @@ -248,7 +248,7 @@ export class {{classname}} { {{/produces}} ]; const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected != undefined) { + if ((httpHeaderAcceptSelected != undefined) && (headers.get('Accept') == undefined)) { {{^useHttpClient}} headers.set('Accept', httpHeaderAcceptSelected); {{/useHttpClient}}