mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-26 06:10:20 +01:00
fix: unable to cross-domain lookup
This commit is contained in:
parent
0804092426
commit
bbcd6d11ba
3 changed files with 7 additions and 5 deletions
|
@ -1,7 +1,7 @@
|
|||
## 2024.11.1
|
||||
|
||||
### General
|
||||
-
|
||||
- ドメインをまたいだ照会ができない問題を修正
|
||||
|
||||
### Client
|
||||
- Enhance: PC画面でチャンネルが複数列で表示されるように
|
||||
|
|
|
@ -71,7 +71,7 @@ export class Resolver {
|
|||
}
|
||||
|
||||
@bindThis
|
||||
public async resolve(value: string | IObject): Promise<IObject> {
|
||||
public async resolve(value: string | IObject, allowHostMismatch = false): Promise<IObject> {
|
||||
if (typeof value !== 'string') {
|
||||
return value;
|
||||
}
|
||||
|
@ -126,8 +126,10 @@ export class Resolver {
|
|||
throw new Error('invalid AP object: missing id');
|
||||
}
|
||||
|
||||
if (this.utilityService.punyHost(object.id) !== this.utilityService.punyHost(value)) {
|
||||
throw new Error(`invalid AP object ${value}: id ${object.id} has different host`);
|
||||
if (!allowHostMismatch) {
|
||||
if (this.utilityService.punyHost(object.id) !== this.utilityService.punyHost(value)) {
|
||||
throw new Error(`invalid AP object ${value}: id ${object.id} has different host`);
|
||||
}
|
||||
}
|
||||
|
||||
return object;
|
||||
|
|
|
@ -125,7 +125,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
|
||||
// リモートから一旦オブジェクトフェッチ
|
||||
const resolver = this.apResolverService.createResolver();
|
||||
const object = await resolver.resolve(uri) as any;
|
||||
const object = await resolver.resolve(uri, true) as any;
|
||||
|
||||
// /@user のような正規id以外で取得できるURIが指定されていた場合、ここで初めて正規URIが確定する
|
||||
// これはDBに存在する可能性があるため再度DB検索
|
||||
|
|
Loading…
Reference in a new issue