@@ -41,25 +41,18 @@ class CoCreateFileSystem {
4141 res . setHeader ( 'Access-Control-Allow-Methods' , '' ) ;
4242 res . setHeader ( 'Access-Control-Allow-Headers' , 'Content-Type, Authorization' ) ;
4343
44+ let active = crud . wsManager . organizations . get ( organization_id )
45+ if ( active === false ) {
46+ let balanceFalse = await getDefaultFile ( '/balanceFalse.html' )
47+ return sendResponse ( balanceFalse . object [ 0 ] . src , 403 , { 'Content-Type' : 'text/html' , 'Account-Balance' : 'false' , 'storage' : organization . storage } )
48+ }
49+
4450 let parameters = valideUrl . searchParams ;
4551 if ( parameters . size ) {
4652 console . log ( 'parameters' , parameters )
4753 }
4854
4955 let pathname = valideUrl . pathname ;
50- if ( pathname . endsWith ( '/' ) ) {
51- pathname += "index.html" ;
52- } else if ( ! pathname . startsWith ( '/.well-known/acme-challenge' ) ) {
53- let directory = pathname . split ( "/" ) . slice ( - 1 ) [ 0 ] ;
54- if ( ! directory . includes ( '.' ) )
55- pathname += "/index.html" ;
56- }
57-
58- let active = crud . wsManager . organizations . get ( organization_id )
59- if ( active === false ) {
60- let balanceFalse = await getDefaultFile ( '/balanceFalse.html' )
61- return sendResponse ( balanceFalse . object [ 0 ] . src , 403 , { 'Content-Type' : 'text/html' , 'Account-Balance' : 'false' , 'storage' : organization . storage } )
62- }
6356
6457 let lastIndex = pathname . lastIndexOf ( '/' ) ;
6558 let wildcardPath = pathname . substring ( 0 , lastIndex + 1 ) ;
@@ -70,7 +63,15 @@ class CoCreateFileSystem {
7063 let fileExtension = wildcard . substring ( fileLastIndex ) ; // Get extension
7164 wildcard = wildcardPath + '*' + fileExtension ; // Create wildcard for file name
7265 } else {
73- wildcard = wildcardPath + '*' ; // Append '*' if it's just a path or folder
66+ wildcard = wildcardPath + '*/index.html' ; // Append '*' if it's just a path or folder
67+ }
68+
69+ if ( pathname . endsWith ( '/' ) ) {
70+ pathname += "index.html" ;
71+ } else if ( ! pathname . startsWith ( '/.well-known/acme-challenge' ) ) {
72+ let directory = pathname . split ( "/" ) . slice ( - 1 ) [ 0 ] ;
73+ if ( ! directory . includes ( '.' ) )
74+ pathname += "/index.html" ;
7475 }
7576
7677 // console.log("Wildcard: ", wildcard);
0 commit comments