Skip to content

Commit 4f10c22

Browse files
authoredMay 17, 2021
Merge pull request #470 from linkeddata/fix-options-headers
Fix options.headers
2 parents 555e473 + 0c8b2c3 commit 4f10c22

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed
 

‎src/fetcher.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,7 @@ export default class Fetcher implements CallbackifyInterface {
10311031
options.baseURI = options.baseURI || uri // Preserve though proxying etc
10321032
options.original = kb.rdfFactory.namedNode(options.baseURI)
10331033
options.req = kb.bnode()
1034-
options.headers = options.headers || new Headers
1034+
options.headers = options.headers || new Headers()
10351035

10361036
if (options.contentType) {
10371037
options.headers['content-type'] = options.contentType
@@ -1122,6 +1122,14 @@ export default class Fetcher implements CallbackifyInterface {
11221122

11231123
let { actualProxyURI } = options
11241124

1125+
// Map might get mistakenly added into headers
1126+
// error TS2339: Property 'map' does not exist on type 'Headers'.
1127+
/*
1128+
let map
1129+
if (options.headers && map in options.headers) {
1130+
delete options.headers.map
1131+
} */
1132+
11251133
return this._fetch((actualProxyURI as string), options)
11261134
.then(response => this.handleResponse(response, docuri, options),
11271135
error => { // @@ handleError?

0 commit comments

Comments
 (0)