| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -139,7 +139,7 @@ function parseKeyObject(keyObj) { | |
| async function fetchProfileKeys(webId) { | ||
| const response = await fetchWithTimeout(webId, { | ||
| headers: { | ||
| 'Accept': 'application/ld+json, text/turtle, application/json' | ||
| 'Accept': 'text/html' | ||
| } | ||
| }); | ||
|
|
||
| Expand All | @@ -157,7 +157,7 @@ async function fetchProfileKeys(webId) { | |
| jsonLd = await turtleToJsonLd(text, webId); | ||
| } else if (contentType.includes('text/html')) { | ||
| // Try to extract JSON-LD from HTML data island | ||
| const jsonLdMatch = text.match(/<script\s+type=["']application\/ld\+json["']\s*>([\s\S]*?)<\/script>/i); | ||
| const jsonLdMatch = text.match(/<script[^>]*type=["']application\/ld\+json["'][^>]*>([\s\S]*?)<\/script>/i); | ||
|
Comment thread
|
||
| if (jsonLdMatch) { | ||
| jsonLd = JSON.parse(jsonLdMatch[1]); | ||
| } else { | ||
| Expand Down | ||
| Back | FazBrowse Home | New Git URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityRestricting the Accept header to only 'text/html' could break WebID-TLS authentication for profiles served exclusively as Turtle or JSON-LD. While this may work around conneg issues with HTML profiles, the code at lines 155-169 still handles multiple content types in the response. Consider using 'text/html, application/ld+json;q=0.9, text/turtle;q=0.8' to indicate HTML preference while maintaining backward compatibility with non-HTML profiles. Alternatively, if HTML-only is intentional, remove the dead code paths for handling Turtle and JSON-LD content types.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.