Fix: <link rel="alternate">
を追って照会するのはOKレスポンスが返却された場合のみに (#14627)
* Only accept HTML `<link rel="alternate">` on success (cherry picked from commit6ea48be84a
) * Use `res.ok` instead of 200-299 (cherry picked from commitb667a68bd4
) * jsdomに戻す * Update Changelog * Revert "jsdomに戻す" This reverts commit c03603611b74d16df52e77e44c558e958a82f3f4. * 🎨 --------- Co-authored-by: Julia Johannesen <julia@insertdomain.name>
This commit is contained in:
parent
53682f5cc6
commit
dd124a8aed
2 changed files with 7 additions and 1 deletions
|
@ -38,6 +38,8 @@
|
||||||
(Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/commit/8a982c61c01909e7540ff1be9f019df07c3f0624)
|
(Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/commit/8a982c61c01909e7540ff1be9f019df07c3f0624)
|
||||||
- Fix: サーバーサイドのDOM解析完了時にリソースを開放するように
|
- Fix: サーバーサイドのDOM解析完了時にリソースを開放するように
|
||||||
(Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/634)
|
(Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/634)
|
||||||
|
- Fix: `<link rel="alternate">`を追って照会するのはOKレスポンスが返却された場合のみに
|
||||||
|
(Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/633)
|
||||||
|
|
||||||
## 2024.8.0
|
## 2024.8.0
|
||||||
|
|
||||||
|
|
|
@ -205,7 +205,11 @@ export class ApRequestService {
|
||||||
//#region リクエスト先がhtmlかつactivity+jsonへのalternate linkタグがあるとき
|
//#region リクエスト先がhtmlかつactivity+jsonへのalternate linkタグがあるとき
|
||||||
const contentType = res.headers.get('content-type');
|
const contentType = res.headers.get('content-type');
|
||||||
|
|
||||||
if ((contentType ?? '').split(';')[0].trimEnd().toLowerCase() === 'text/html' && _followAlternate === true) {
|
if (
|
||||||
|
res.ok &&
|
||||||
|
(contentType ?? '').split(';')[0].trimEnd().toLowerCase() === 'text/html' &&
|
||||||
|
_followAlternate === true
|
||||||
|
) {
|
||||||
const html = await res.text();
|
const html = await res.text();
|
||||||
const { window, happyDOM } = new Window({
|
const { window, happyDOM } = new Window({
|
||||||
settings: {
|
settings: {
|
||||||
|
|
Loading…
Reference in a new issue