Skip to content

Commit

Permalink
feat: pass in Options Object to http Constructor (#37)
Browse files Browse the repository at this point in the history
It looks like the function was written to allow this as a parameter, but it was never used. This should allow for use cases like specifying custom headers while using `urlSource`. The `node-fetch` module falls back on [default options](https://github.com/node-fetch/node-fetch#options) if none are specified, so we shouldn't need to check and send an empty object at this step.
  • Loading branch information
leoherzog authored Apr 21, 2020
1 parent 6564b06 commit 727f28d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/files/url-source.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
const Http = require('../http')

module.exports = async function * urlSource (url, options) {
options = options || {}
const http = new Http()
const response = await http.get(url)
const response = await http.get(url, options)

yield {
path: decodeURIComponent(new URL(url).pathname.split('/').pop() || ''),
Expand Down

0 comments on commit 727f28d

Please sign in to comment.