diff --git a/README.md b/README.md index f2ad001..5092b44 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ Please **DO NOT** abuse this service. - [ ] Expiring paste (*not support directly, see [this section](#expiring-paste)*) - [ ] Render paste code with syntax highlighting - [x] Generate QR code for paste link +- [x] Support URL redirection using [HTTP status codes 301](https://en.wikipedia.org/wiki/URL_redirection#HTTP_status_codes_3xx) ## Service architecture @@ -117,6 +118,7 @@ Add `?qr=1` to enable QR code generation for paste link. |`pass`|Paste's password| |`read-limit`|The maximum access count| |`qrcode`|Toggle QR code generation| +|`paste-type`|Set paste type| #### For raw request, @@ -126,9 +128,17 @@ Add `?qr=1` to enable QR code generation for paste link. |`x-title`|File's title| |`x-pass`|Paste's password| |`x-read-limit`|The maximum access count| +|`x-paste-type`|Set paste type| The request body contains the upload content. +#### Paste type + +|Type|Description| +|-|-| +|`paste`|Normal paste content| +|`link`|URL link to be redirected| + ### GET /\/\ (Not implemented) Fetch the paste (code) in rendered HTML with syntax highlighting @@ -139,6 +149,7 @@ Currently, only the following options is supported for `option` |`settings`|Fetch the paste information| |`download`|Download paste as attachment| |`raw`|Display paste as plain text| +|`link`|Treat paste content as URL link| *The authentication requirement is as same as `GET /`.* diff --git a/paste.html b/paste.html index 0bba955..8c6d9a8 100644 --- a/paste.html +++ b/paste.html @@ -46,7 +46,7 @@

Upload text

+ name="u" placeholder="Paste text or URL link here..." spellcheck="false">

Settings

@@ -63,6 +63,10 @@
+
+ + +

diff --git a/src/index.ts b/src/index.ts index 63bcae8..87d83f7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -58,6 +58,7 @@ GET //