@@ -148,7 +148,7 @@ exports.prepareForStaticDownload = async ({ staticAssetRootDir }) => {
148148
149149// Async file download to public folder.
150150async function downloadToPublic (
151- fileUrl , storagePath , storageName , auth ,
151+ fileUrl , storagePath , storageName , oAuthStr ,
152152) {
153153 // Make the subdirectory to store the file
154154 try {
@@ -159,7 +159,7 @@ async function downloadToPublic(
159159
160160 // Download the file
161161 const headers = new Headers ( {
162- Authorization : `${ auth } ` ,
162+ Authorization : `${ oAuthStr } ` ,
163163 Accept : '*/*' ,
164164 Connection : 'keep-alive' ,
165165 'User-Agent' : 'oracle/gatsby-source-oce' ,
@@ -187,7 +187,7 @@ exports.downloadMediaFilesToStaticDir = async ({
187187 staticAssetRootDir,
188188 staticUrlPrefix,
189189 renditions,
190- auth ,
190+ oAuthStr ,
191191} ) => {
192192 const dataItemMap = new Map ( ) ;
193193 // Build a map of files that we need to download
@@ -209,7 +209,7 @@ exports.downloadMediaFilesToStaticDir = async ({
209209
210210 const promises = [ ] ;
211211 dataItemMap . forEach ( async ( value ) => {
212- promises . push ( downloadToPublic ( value . fileUrl , value . storagePath , value . storageName , auth ) ) ;
212+ promises . push ( downloadToPublic ( value . fileUrl , value . storagePath , value . storageName , oAuthStr ) ) ;
213213 } ) ;
214214
215215 await Promise . all ( promises ) ;
@@ -224,7 +224,7 @@ exports.downloadMediaFiles = async ({
224224 createNodeId,
225225 touchNode,
226226 renditions,
227- auth ,
227+ oAuthStr ,
228228} ) => Promise . all (
229229 entities . map ( async ( e ) => {
230230 if ( isDigitalAsset ( e ) ) {
@@ -252,11 +252,11 @@ exports.downloadMediaFiles = async ({
252252 try {
253253 console . log ( `downloading mediaFile ${ mediaObject . url } ` ) ;
254254 let fileNode = null ;
255- // If auth is defined, the download will be from a preview (management) call or
255+ // If oAuthStr is defined, the download will be from a preview (management) call or
256256 // from a secure channel.
257257 let httpHeaders = '' ;
258- if ( auth !== '' ) {
259- httpHeaders = { Authorization : `${ auth } ` } ;
258+ if ( oAuthStr !== '' ) {
259+ httpHeaders = { Authorization : `${ oAuthStr } ` } ;
260260 }
261261 fileNode = await createRemoteFileNode ( {
262262 url : mediaObject . url ,
0 commit comments