File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -184,6 +184,9 @@ export class {{classname}} {
184184{ {/hasQueryParams} }
185185 let headers = { {#useHttpClient} }this.defaultHeaders;{ {/useHttpClient} }{ {^useHttpClient} }new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845{ {/useHttpClient} }
186186{ {#headerParams} }
187+ if(typeof this.configuration.defaultHeaderValue === 'function') {
188+ {{paramName} } = this.configuration.defaultHeaderValue('{ {paramName} }');
189+ }
187190 { {#isListContainer} }
188191 if ({ {paramName} }) {
189192 {{#useHttpClient} }headers = { {/useHttpClient} }headers.set('{ {baseName} }', { {paramName} }.join(COLLECTION_FORMATS['{ {collectionFormat} }']));
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ export interface ConfigurationParameters {
1414 password?: string;
1515 accessToken?: string | (() => string);
1616 errorHandler?: (err: any, operationName: string) => Observable<never >;
17+ defaultHeaderValue?: (headerName: string) => string;
1718 basePath?: string;
1819 withCredentials?: boolean;
1920}
@@ -24,6 +25,7 @@ export class Configuration {
2425 password?: string;
2526 accessToken?: string | (() => string);
2627 errorHandler?: (err: any, operationName: string) => Observable<never >;
28+ defaultHeaderValue?: (headerName: string) => string;
2729 basePath?: string;
2830 withCredentials?: boolean;
2931
@@ -33,6 +35,7 @@ export class Configuration {
3335 this.password = configurationParameters.password;
3436 this.accessToken = configurationParameters.accessToken;
3537 this.errorHandler = configurationParameters.errorHandler;
38+ this.defaultHeaderValue = configurationParameters.defaultHeaderValue;
3639 this.basePath = configurationParameters.basePath;
3740 this.withCredentials = configurationParameters.withCredentials;
3841 }
You can’t perform that action at this time.
0 commit comments