From 79d9eadd58f9242e0b24095ee482bcaeebeed11e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=8A=E3=81=95=E3=82=80=E3=81=AE=E3=81=B2=E3=81=A8?= <46447427+samunohito@users.noreply.github.com> Date: Mon, 18 Mar 2024 10:51:35 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=AC=A1=E3=83=90=E3=83=BC=E3=82=B8?= =?UTF-8?q?=E3=83=A7=E3=83=B3=E3=81=AB=E5=90=91=E3=81=91=E3=81=A6=E3=81=AE?= =?UTF-8?q?=E8=A8=98=E8=BC=89=E3=82=92=E8=BF=BD=E5=8A=A0=20(#25)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 9 +++++++++ README.md | 49 +++++++++++++++++++++++++++---------------------- package.json | 2 +- 3 files changed, 37 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8648806d..840e53be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +5.1.0 / 2024-xx-xx +* GETリクエストよりも前にHEADリクエストを送信し、その結果を使用して検証するように (#22) +* 下記のパラメータを`summaly`メソッドのオプションに追加 + - userAgent + - responseTimeout + - operationTimeout + - contentLengthLimit + - contentLengthRequired + 5.0.3 / 2023-12-30 ------------------ * Fix .github/workflows/npm-publish.yml diff --git a/README.md b/README.md index 94e3b616..17099324 100644 --- a/README.md +++ b/README.md @@ -43,12 +43,17 @@ npm run serve #### opts (SummalyOptions) -| Property | Type | Description | Default | -| :------------------ | :--------------------- | :------------------------------ | :------ | -| **lang** | *string* | Accept-Language for the request | `null` | -| **followRedirects** | *boolean* | Whether follow redirects | `true` | -| **plugins** | *plugin[]* (see below) | Custom plugins | `null` | -| **agent** | *Got.Agents* | Custom HTTP agent (see below) | `null` | +| Property | Type | Description | Default | +|:--------------------------|:-----------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------------| +| **lang** | *string* | Accept-Language for the request | `null` | +| **followRedirects** | *boolean* | Whether follow redirects | `true` | +| **plugins** | *plugin[]* (see below) | Custom plugins | `null` | +| **agent** | *Got.Agents* | Custom HTTP agent (see below) | `null` | +| **userAgent** | *string* | User-Agent for the request | `SummalyBot/[version]` | +| **responseTimeout** | *number* | Set timeouts for each phase, such as host name resolution and socket communication. | `20000` | +| **operationTimeout** | *number* | Set the timeout from the start to the end of the request. | `60000` | +| **contentLengthLimit** | *number* | If set to true, an error will occur if the content-length value returned from the other server is larger than this parameter (or if the received body size exceeds this parameter). | `10485760` | +| **contentLengthRequired** | *boolean* | If set to true, it will be an error if the other server does not return content-length. | `false` | #### Plugin @@ -78,17 +83,17 @@ A Promise of an Object that contains properties below: #### SummalyResult -| Property | Type | Description | -| :-------------- | :------- | :------------------------------------------ | -| **title** | *string* \| *null* | The title of the web page | -| **icon** | *string* \| *null* | The url of the icon of the web page | -| **description** | *string* \| *null* | The description of the web page | -| **thumbnail** | *string* \| *null* | The url of the thumbnail of the web page | -| **sitename** | *string* \| *null* | The name of the web site | -| **player** | *Player* | The player of the web page | -| **sensitive** | *boolean* | Whether the url is sensitive | +| Property | Type | Description | +|:----------------|:-------------------|:-----------------------------------------------------------| +| **title** | *string* \| *null* | The title of the web page | +| **icon** | *string* \| *null* | The url of the icon of the web page | +| **description** | *string* \| *null* | The description of the web page | +| **thumbnail** | *string* \| *null* | The url of the thumbnail of the web page | +| **sitename** | *string* \| *null* | The name of the web site | +| **player** | *Player* | The player of the web page | +| **sensitive** | *boolean* | Whether the url is sensitive | | **activityPub** | *string* \| *null* | The url of the ActivityPub representation of that web page | -| **url** | *string* | The url of the web page | +| **url** | *string* | The url of the web page | #### Summary @@ -96,12 +101,12 @@ A Promise of an Object that contains properties below: #### Player -| Property | Type | Description | -| :-------------- | :--------- | :---------------------------------------------- | -| **url** | *string* \| *null* | The url of the player | -| **width** | *number* \| *null* | The width of the player | -| **height** | *number* \| *null* | The height of the player | -| **allow** | *string[]* | The names of the allowed permissions for iframe | +| Property | Type | Description | +|:-----------|:-------------------|:------------------------------------------------| +| **url** | *string* \| *null* | The url of the player | +| **width** | *number* \| *null* | The width of the player | +| **height** | *number* \| *null* | The height of the player | +| **allow** | *string[]* | The names of the allowed permissions for iframe | Currently the possible items in `allow` are: diff --git a/package.json b/package.json index e8167eb8..c33c9f07 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@misskey-dev/summaly", - "version": "5.0.4", + "version": "5.1.0", "description": "Get web page's summary", "author": "syuilo ", "license": "MIT",