diff options
| author | taichan <40626578+tai-cha@users.noreply.github.com> | 2024-08-17 19:51:56 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-17 19:51:56 +0900 |
| commit | bf8c42eecd3d645652ddd7e69b727ced2a15457d (patch) | |
| tree | 228e1280d31675a6fa8d6edadb05aa93349d73d2 | |
| parent | Update packages/backend/src/core/activitypub/ApRequestService.ts (diff) | |
| download | sharkey-bf8c42eecd3d645652ddd7e69b727ced2a15457d.tar.gz sharkey-bf8c42eecd3d645652ddd7e69b727ced2a15457d.tar.bz2 sharkey-bf8c42eecd3d645652ddd7e69b727ced2a15457d.zip | |
Fix(beckend): html content-type detection on signedGet (#14424)
* fix(backend): contenttype detection of html in signedGet
* code style
* fix by review
| -rw-r--r-- | packages/backend/src/core/activitypub/ApRequestService.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/backend/src/core/activitypub/ApRequestService.ts b/packages/backend/src/core/activitypub/ApRequestService.ts index 3d1bd44648..7cf8359212 100644 --- a/packages/backend/src/core/activitypub/ApRequestService.ts +++ b/packages/backend/src/core/activitypub/ApRequestService.ts @@ -204,8 +204,8 @@ export class ApRequestService { //#region リクエスト先がhtmlかつactivity+jsonへのalternate linkタグがあるとき const contentType = res.headers.get('content-type'); - - if ((contentType === 'text/html' || contentType?.startsWith('text/html;')) && _followAlternate === true) { + + if ((contentType ?? '').split(';')[0].trimEnd().toLowerCase() === 'text/html' && _followAlternate === true) { const html = await res.text(); const window = new Window(); const document = window.document; |