Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 30 additions & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 8 additions & 21 deletions src/utils/webIdUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,6 @@
uri: NamedNode
): Promise<NamedNode> {
try {
const pod = uri.site().uri
// TODO: This is a hack - we cannot assume that the profile is at this document, but we will live with it for now
const webId = sym(`${pod}${DEFAULT_PROFILE_PATH}`)
try {
await store.fetcher.load(webId)
return webId
} catch (err) {
// ignore any failure and continue fallback lookup
}

// we try a prefixed pod structure
try {
const uriUrl = new URL(uri.uri)
Expand All @@ -33,6 +23,10 @@
await store.fetcher.load(derivedWebId)
return derivedWebId
}

const rootWebId = sym(`${uriUrl.origin}/profile/card#me`)
await store.fetcher.load(rootWebId)
return rootWebId
Comment on lines +27 to +29
} catch (err) {
// ignore any failure and continue fallback lookup
}
Expand Down Expand Up @@ -71,17 +65,6 @@
export async function getNameOfPodOwner (
pod: NamedNode
): Promise<string> {
// TODO: This is a hack - we cannot assume that the profile is at this document, but we will live with it for now
const webId = sym(`${pod.uri}${DEFAULT_PROFILE_PATH}`)
try {
await store.fetcher.load(webId)
return getName(store, webId)
} catch (err) {
if (!isFetchErrorStatus(err, 403)) {
console.error('getNameOfPodOwner failed on default profile:', err)
}
}

// we try a prefixed pod structure
try {
const uriUrl = new URL(pod.uri)
Expand All @@ -92,6 +75,10 @@
await store.fetcher.load(derivedWebId)
return getName(store, derivedWebId)
}

const rootWebId = sym(`${uriUrl.origin}/profile/card#me`)

Check failure on line 79 in src/utils/webIdUtils.ts

View workflow job for this annotation

GitHub Actions / build (24)

Expected indentation of 4 spaces but found 6

Check failure on line 79 in src/utils/webIdUtils.ts

View workflow job for this annotation

GitHub Actions / build (22)

Expected indentation of 4 spaces but found 6
await store.fetcher.load(rootWebId)

Check failure on line 80 in src/utils/webIdUtils.ts

View workflow job for this annotation

GitHub Actions / build (24)

Expected indentation of 4 spaces but found 6

Check failure on line 80 in src/utils/webIdUtils.ts

View workflow job for this annotation

GitHub Actions / build (22)

Expected indentation of 4 spaces but found 6
return getName(store, rootWebId)

Check failure on line 81 in src/utils/webIdUtils.ts

View workflow job for this annotation

GitHub Actions / build (24)

Expected indentation of 4 spaces but found 6

Check failure on line 81 in src/utils/webIdUtils.ts

View workflow job for this annotation

GitHub Actions / build (22)

Expected indentation of 4 spaces but found 6
Comment on lines +79 to +81
} catch (err) {
if (!isFetchErrorStatus(err, 403)) {
console.error('getNameOfPodOwner failed on derived profile:', err)
Expand Down
Loading