Skip to content
Snippets Groups Projects
Unverified Commit 12fe09c6 authored by CyberRex's avatar CyberRex Committed by GitHub
Browse files

プロフィールのURL認証をrel=meで可能に (#12100)

parent 2c0a139d
No related branches found
No related tags found
No related merge requests found
......@@ -437,9 +437,13 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
const myLink = `${this.config.url}/@${user.username}`;
const includesMyLink = Array.from(doc.getElementsByTagName('a')).some(a => a.href === myLink);
const aEls = Array.from(doc.getElementsByTagName('a'));
const linkEls = Array.from(doc.getElementsByTagName('link'));
if (includesMyLink) {
const includesMyLink = aEls.some(a => a.href === myLink);
const includesRelMeLinks = [...aEls, ...linkEls].some(link => link.rel === 'me' && link.href === myLink);
if (includesMyLink || includesRelMeLinks) {
await this.userProfilesRepository.createQueryBuilder('profile').update()
.where('userId = :userId', { userId: user.id })
.set({
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment