File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 11[project ]
22name = " comfyui-videohelpersuite"
33description = " Nodes related to video workflows"
4- version = " 1.7.8 "
4+ version = " 1.7.9 "
55license = { file = " LICENSE" }
66dependencies = [" opencv-python" , " imageio-ffmpeg" ]
77
Original file line number Diff line number Diff line change @@ -458,6 +458,17 @@ function allowDragFromWidget(widget) {
458458 }
459459}
460460
461+ //Cloud specific auth code. Short circuits if not on cloud
462+ async function getAuthHeader ( ) {
463+ try {
464+ const authStore = await api . getAuthStore ( )
465+ return authStore ? await authStore . getAuthHeader ( ) : null
466+ } catch ( error ) {
467+ console . warn ( 'Failed to get auth header:' , error )
468+ return null
469+ }
470+ }
471+
461472async function uploadFile ( file , progressCallback ) {
462473 try {
463474 // Wrap file in formdata so it includes filename
@@ -478,7 +489,12 @@ async function uploadFile(file, progressCallback) {
478489 req . upload . onprogress = ( e ) => progressCallback ?. ( e . loaded / e . total )
479490 req . onload = ( ) => resolve ( req )
480491 req . open ( 'post' , url , true )
481- req . send ( body )
492+ getAuthHeader ( ) . then ( ( headers ) => {
493+ headers ??= { }
494+ for ( const key in headers )
495+ req . set ( key , headers [ key ] )
496+ req . send ( body )
497+ } )
482498 } )
483499
484500 if ( resp . status !== 200 ) {
You can’t perform that action at this time.
0 commit comments