File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -1168,6 +1168,30 @@ export async function getWellKnownSolid(
11681168 // at the pod's root.
11691169 }
11701170
1171+ // 1.1s implementation:
1172+ const resourceMetadata = await getResourceInfo ( urlString , {
1173+ fetch : options ?. fetch ,
1174+ // Discovering the .well-known/solid document is useful even for resources
1175+ // we don't have access to.
1176+ ignoreAuthenticationErrors : true ,
1177+ } ) ;
1178+ const linkedResources = getLinkedResourceUrlAll ( resourceMetadata ) ;
1179+ const rootResources = linkedResources [ pim . storage ] ;
1180+ const rootResource = rootResources ?. length === 1 ? rootResources [ 0 ] : null ;
1181+ // If pod root (storage) was advertised, retrieve well known solid from pod's root
1182+ if ( rootResource !== null ) {
1183+ const wellKnownSolidUrl = new URL (
1184+ ".well-known/solid" ,
1185+ rootResource . endsWith ( "/" ) ? rootResource : `${ rootResource } /` ,
1186+ ) . href ;
1187+ return getSolidDataset ( wellKnownSolidUrl , {
1188+ ...options ,
1189+ parsers : {
1190+ "application/ld+json" : getJsonLdParser ( ) ,
1191+ } ,
1192+ } ) ;
1193+ }
1194+
11711195 throw new Error (
11721196 "Could not determine storage root or well-known solid resource." ,
11731197 ) ;
You can’t perform that action at this time.
0 commit comments