fedimbed.bluesky: support did:web:
This commit is contained in:
parent
0d78c16e69
commit
cb503762a7
1 changed files with 3 additions and 2 deletions
|
@ -17,7 +17,8 @@ const FRIENDLY_USERAGENT = "HiddenPhox/fedimbed (https://gitdab.com/Cynosphere/H
|
|||
const URLS_REGEX = /(?:\s|^|\]\()(\|\|\s*)?(https?:\/\/[^\s<]+[^<.,:;"'\]|)\s])(\s*\)?\|\||\s*[\S]*?\))?/g;
|
||||
const SPOILER_REGEX = /(?:\s|^)\|\|([\s\S]+?)\|\|/;
|
||||
|
||||
const BSKY_POST_REGEX = /^\/profile\/(did:plc:[a-z0-9]+|[a-z0-9][a-z0-9.-]+[a-z0-9]*)\/post\/([a-z0-9]+)\/?$/i;
|
||||
const BSKY_POST_REGEX =
|
||||
/^\/profile\/(did:plc:[a-z0-9]+|(did:web:)?[a-z0-9][a-z0-9.-]+[a-z0-9]*)\/post\/([a-z0-9]+)\/?$/i;
|
||||
|
||||
const PATH_REGEX = {
|
||||
mastodon: /^\/@(.+?)\/(\d+)\/?/,
|
||||
|
@ -326,7 +327,7 @@ async function bluesky(msg, url, spoiler = false) {
|
|||
const postMatch = urlObj.pathname.match(BSKY_POST_REGEX);
|
||||
if (!postMatch) return {};
|
||||
|
||||
const [_, user, postId] = postMatch;
|
||||
const [, user, , postId] = postMatch;
|
||||
const postUri = `at://${user}/app.bsky.feed.post/${postId}`;
|
||||
|
||||
const res = await fetch(
|
||||
|
|
Loading…
Reference in a new issue