Comparing version 0.9.0 to 0.9.1
@@ -5,2 +5,17 @@ # Changelog | ||
### [0.9.1](https://github.com/wikibus/alcaeus/compare/v0.9.0...v0.9.1) (2019-08-16) | ||
### Bug Fixes | ||
* headers do not get properly overridden when casing differs ([7f3a62e](https://github.com/wikibus/alcaeus/commit/7f3a62e)) | ||
* warn about unsupported media type ([661c966](https://github.com/wikibus/alcaeus/commit/661c966)), closes [#47](https://github.com/wikibus/alcaeus/issues/47) | ||
### Tests | ||
* make sure header merging accepts arrays ([93723f8](https://github.com/wikibus/alcaeus/commit/93723f8)) | ||
## [0.9.0](https://github.com/wikibus/alcaeus/compare/v0.8.1...v0.9.0) (2019-08-15) | ||
@@ -7,0 +22,0 @@ |
// tslint:disable no-console | ||
import { Core } from './Constants'; | ||
import * as FetchUtil from './FetchUtil'; | ||
import { merge } from './helpers/MergeHeaders'; | ||
import { create } from './HydraResponse'; | ||
@@ -12,2 +13,3 @@ const getHydraResponse = async (alcaeus, response, uri, apiDocumentation) => { | ||
} | ||
console.warn(`No processor found for media type ${response.mediaType}`); | ||
return create(uri, response); | ||
@@ -85,8 +87,5 @@ }; | ||
const defaultHeaders = typeof this.defaultHeaders === 'function' ? this.defaultHeaders() : this.defaultHeaders; | ||
return { | ||
...(defaultHeaders || {}), | ||
...headers, | ||
}; | ||
return merge(defaultHeaders, headers); | ||
} | ||
} | ||
//# sourceMappingURL=alcaeus.js.map |
import 'isomorphic-fetch'; | ||
import * as Constants from './Constants'; | ||
import { ResponseWrapper } from './ResponseWrapper'; | ||
import { merge } from './helpers/MergeHeaders'; | ||
// tslint:disable:max-line-length | ||
@@ -17,6 +18,3 @@ const requestAcceptHeaders = Constants.MediaTypes.jsonLd + ', ' + Constants.MediaTypes.ntriples + ', ' + Constants.MediaTypes.nquads; | ||
} | ||
requestInit.headers = new Headers({ | ||
...defaultHeaders, | ||
...headers, | ||
}); | ||
requestInit.headers = new Headers(merge(defaultHeaders, headers)); | ||
const res = await fetch(uri, requestInit); | ||
@@ -23,0 +21,0 @@ return new ResponseWrapper(uri, res); |
@@ -13,2 +13,3 @@ "use strict"; | ||
const FetchUtil = __importStar(require("./FetchUtil")); | ||
const MergeHeaders_1 = require("./helpers/MergeHeaders"); | ||
const HydraResponse_1 = require("./HydraResponse"); | ||
@@ -22,2 +23,3 @@ const getHydraResponse = async (alcaeus, response, uri, apiDocumentation) => { | ||
} | ||
console.warn(`No processor found for media type ${response.mediaType}`); | ||
return HydraResponse_1.create(uri, response); | ||
@@ -95,3 +97,3 @@ }; | ||
const defaultHeaders = typeof this.defaultHeaders === 'function' ? this.defaultHeaders() : this.defaultHeaders; | ||
return Object.assign({}, (defaultHeaders || {}), headers); | ||
return MergeHeaders_1.merge(defaultHeaders, headers); | ||
} | ||
@@ -98,0 +100,0 @@ } |
@@ -13,2 +13,3 @@ "use strict"; | ||
const ResponseWrapper_1 = require("./ResponseWrapper"); | ||
const MergeHeaders_1 = require("./helpers/MergeHeaders"); | ||
// tslint:disable:max-line-length | ||
@@ -27,3 +28,3 @@ const requestAcceptHeaders = Constants.MediaTypes.jsonLd + ', ' + Constants.MediaTypes.ntriples + ', ' + Constants.MediaTypes.nquads; | ||
} | ||
requestInit.headers = new Headers(Object.assign({}, defaultHeaders, headers)); | ||
requestInit.headers = new Headers(MergeHeaders_1.merge(defaultHeaders, headers)); | ||
const res = await fetch(uri, requestInit); | ||
@@ -30,0 +31,0 @@ return new ResponseWrapper_1.ResponseWrapper(uri, res); |
{ | ||
"name": "alcaeus", | ||
"version": "0.9.0", | ||
"version": "0.9.1", | ||
"description": "Hydra Core hypermedia-aware client library", | ||
@@ -22,2 +22,3 @@ "main": "lib/node/index.js", | ||
"build:gitbook": "gitbook install; gitbook build . docs/latest", | ||
"gitbook": "gitbook serve", | ||
"lint": "eslint . --ext .ts --quiet", | ||
@@ -50,2 +51,7 @@ "prepare": "rm -rf lib; npm run build", | ||
"es6-url-template": "^1.0.3", | ||
"gitbook-plugin-advanced-emoji": "^0.2.2", | ||
"gitbook-plugin-etoc": "^1.2.2", | ||
"gitbook-plugin-forkmegithub": "^2.2.0", | ||
"gitbook-plugin-hints": "^1.0.2", | ||
"gitbook-plugin-runkit": "0.0.1", | ||
"isomorphic-fetch": "^2.2.1", | ||
@@ -52,0 +58,0 @@ "jsonld": "^1.4.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
314960
249
4770
15
+ Addedgitbook-plugin-etoc@^1.2.2
+ Addedgitbook-plugin-hints@^1.0.2
+ Addedgitbook-plugin-runkit@0.0.1
+ Addedansi-red@0.1.1(transitive)
+ Addedansi-wrap@0.1.0(transitive)
+ Addedargparse@1.0.10(transitive)
+ Addedautolinker@0.28.1(transitive)
+ Addedbuffer-from@1.1.2(transitive)
+ Addedcoffee-script@1.12.7(transitive)
+ Addedconcat-stream@1.6.2(transitive)
+ Addedconcat-with-sourcemaps@1.1.0(transitive)
+ Addedemojify.js@1.1.0(transitive)
+ Addedesprima@4.0.1(transitive)
+ Addedexpand-range@1.8.2(transitive)
+ Addedextend-shallow@2.0.1(transitive)
+ Addedfill-range@2.2.4(transitive)
+ Addedfor-in@1.0.2(transitive)
+ Addedgitbook-plugin-advanced-emoji@0.2.2(transitive)
+ Addedgitbook-plugin-etoc@1.2.2(transitive)
+ Addedgitbook-plugin-forkmegithub@2.2.0(transitive)
+ Addedgitbook-plugin-hints@1.0.2(transitive)
+ Addedgitbook-plugin-runkit@0.0.1(transitive)
+ Addedgithub-slugid@1.0.1(transitive)
+ Addedgray-matter@2.1.1(transitive)
+ Addedgulp-header@1.8.12(transitive)
+ Addedis-buffer@1.1.6(transitive)
+ Addedis-extendable@0.1.11.0.1(transitive)
+ Addedis-number@2.1.04.0.0(transitive)
+ Addedis-plain-object@2.0.4(transitive)
+ Addedisobject@2.1.03.0.1(transitive)
+ Addedjs-yaml@3.14.1(transitive)
+ Addedkind-of@3.2.26.0.3(transitive)
+ Addedlazy-cache@2.0.2(transitive)
+ Addedlist-item@1.1.1(transitive)
+ Addedlodash._reinterpolate@3.0.0(transitive)
+ Addedlodash.template@4.5.0(transitive)
+ Addedlodash.templatesettings@4.2.0(transitive)
+ Addedmarkdown-link@0.1.1(transitive)
+ Addedmarkdown-toc@0.12.16(transitive)
+ Addedmath-random@1.0.4(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedmixin-deep@1.3.2(transitive)
+ Addedobject.pick@1.3.0(transitive)
+ Addedrandomatic@3.1.1(transitive)
+ Addedremarkable@1.7.4(transitive)
+ Addedrepeat-element@1.1.4(transitive)
+ Addedrepeat-string@1.6.1(transitive)
+ Addedset-getter@0.1.1(transitive)
+ Addedsource-map@0.6.1(transitive)
+ Addedsprintf-js@1.0.3(transitive)
+ Addedstrip-color@0.1.0(transitive)
+ Addedthrough2@2.0.5(transitive)
+ Addedto-object-path@0.3.0(transitive)
+ Addedtoml@2.3.6(transitive)
+ Addedtypedarray@0.0.6(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedstring_decoder@1.3.0(transitive)