all repos — tabemono @ 84c83e23ec2cdd455d117d9fe7a08a11c9e3a600

🐛 Fix IRI in pod response
Tim Izzo tim@5ika.ch
Mon, 06 Jan 2025 18:12:40 +0100
commit

84c83e23ec2cdd455d117d9fe7a08a11c9e3a600

parent

cd0066f4bba6c2dfe2c4ed857be4ec7517991ce1

1 files changed, 5 insertions(+), 4 deletions(-)

jump to
M src/lib/solid.tssrc/lib/solid.ts

@@ -1,14 +1,15 @@

import { getSolidDataset, getStringNoLocale, getThingAll, getUrl } from '@inrupt/solid-client'; import { FOAF, VCARD } from '@inrupt/vocab-common-rdf'; -export const fetchPod: typeof fetch = async (resource: URL | RequestInfo) => - fetch(`/solid/fetch?resource=${encodeURIComponent(resource.toString())}`); +export const fetchPod: typeof fetch = async (resource: URL | RequestInfo) => { + const response = await fetch(`/solid/fetch?resource=${encodeURIComponent(resource.toString())}`); + Object.defineProperty(response, 'url', { value: decodeURIComponent(resource.toString()) }); + return response; +}; export const getProfile = async (webId: string) => { const dataset = await getSolidDataset(webId, { fetch: fetchPod }); const subjects = getThingAll(dataset); - - console.log({ webId, subjects }); const findValue = (predicate: string) => subjects