Skip to content

Commit

Permalink
fix(cli): Incorrect auth headers and stream type changes from #2017
Browse files Browse the repository at this point in the history
  • Loading branch information
nellh committed Apr 21, 2021
1 parent 23f0fc1 commit b7717bb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/openneuro-cli/src/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const testFile = (destination, filename, size) => {
}

const getFetchHeaders = () => ({
Authorization: `Bearer ${getToken()}`,
cookie: `accessToken=${getToken()}`,
})

const handleFetchReject = err => {
Expand Down Expand Up @@ -92,8 +92,8 @@ export const downloadFile = async (
const response = await fetch(fileUrl, {
headers: getFetchHeaders(),
})
// @ts-expect-error
const stream = await response.readable()
/** @ts-expect-error @type {import('stream').Readable} */
const stream = response.body
if (response.status === 200) {
// Setup end/error handler with Promise interface
const responsePromise = new Promise((resolve, reject) => {
Expand Down

0 comments on commit b7717bb

Please sign in to comment.