diff --git a/package.json b/package.json index e91aced..dd59abb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@restyard/siren-client", - "version": "0.3.0", + "version": "0.3.1", "description": "Basic siren client.", "main": "./dist/cjs/index.js", "module": "./dist/esm5/index.js", diff --git a/src/siren-deserializer.ts b/src/siren-deserializer.ts index 5b5c113..9858b43 100644 --- a/src/siren-deserializer.ts +++ b/src/siren-deserializer.ts @@ -13,6 +13,7 @@ import { EmbeddedEntity } from './siren-model/embedded-entity'; import { ObservableLruCache } from './observable-lru-cache'; import { MediaTypes } from "./media-types"; +import { HttpHeadersFactory } from './contracts'; export class SirenDeserializer { private readonly waheActionTypes = [MediaTypes.Json, MediaTypes.FormData, MediaTypes.OctetStream]; @@ -20,6 +21,7 @@ export class SirenDeserializer { private static httpInputTypeFile = 'file'; constructor( private httpClient: HttpClient, + private httpHeadersFactory: HttpHeadersFactory, private schemaCache: ObservableLruCache, // todo convert to interface, let users inject it private schemaSimplifier: SchemaSimplifier // todo convert to interface, let users inject it ) { @@ -298,7 +300,12 @@ export class SirenDeserializer { return; } - const simplifiedResponse$ = this.httpClient.get(schemaUrl) + var headers = this.httpHeadersFactory.create(); + const simplifiedResponse$ = this.httpClient.get( + schemaUrl, + { + headers: headers + }) .pipe( map(response => { this.schemaSimplifier.simplifySchema(response);