@@ -41,25 +41,18 @@ class CoCreateFileSystem {
41
41
res . setHeader ( 'Access-Control-Allow-Methods' , '' ) ;
42
42
res . setHeader ( 'Access-Control-Allow-Headers' , 'Content-Type, Authorization' ) ;
43
43
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
+
44
50
let parameters = valideUrl . searchParams ;
45
51
if ( parameters . size ) {
46
52
console . log ( 'parameters' , parameters )
47
53
}
48
54
49
55
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
- }
63
56
64
57
let lastIndex = pathname . lastIndexOf ( '/' ) ;
65
58
let wildcardPath = pathname . substring ( 0 , lastIndex + 1 ) ;
@@ -70,7 +63,15 @@ class CoCreateFileSystem {
70
63
let fileExtension = wildcard . substring ( fileLastIndex ) ; // Get extension
71
64
wildcard = wildcardPath + '*' + fileExtension ; // Create wildcard for file name
72
65
} 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" ;
74
75
}
75
76
76
77
// console.log("Wildcard: ", wildcard);
0 commit comments