diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-01-07 20:34:41 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-01-07 20:34:41 +0900 |
| commit | 4e9bb87d9409917f1f3a53fe00292c05507daed1 (patch) | |
| tree | 41d935664dd2ca0927e465d7af2b0d070bdae543 | |
| parent | Revert (diff) | |
| download | misskey-4e9bb87d9409917f1f3a53fe00292c05507daed1.tar.gz misskey-4e9bb87d9409917f1f3a53fe00292c05507daed1.tar.bz2 misskey-4e9bb87d9409917f1f3a53fe00292c05507daed1.zip | |
[Server] Fix bug
| -rw-r--r-- | package.json | 2 | ||||
| -rw-r--r-- | src/web/service/proxy/proxy.ts | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/package.json b/package.json index ad05d17a64..6c93576122 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "@types/gulp-util": "3.0.30", "@types/inquirer": "0.0.32", "@types/is-root": "1.0.0", + "@types/is-url": "1.2.28", "@types/js-yaml": "3.5.29", "@types/mongodb": "2.1.36", "@types/ms": "0.7.29", @@ -95,6 +96,7 @@ "gulp-util": "3.0.8", "inquirer": "2.0.0", "is-root": "1.0.0", + "is-url": "1.2.2", "js-yaml": "3.7.0", "livescript": "1.5.0", "mime-types": "2.1.13", diff --git a/src/web/service/proxy/proxy.ts b/src/web/service/proxy/proxy.ts index 8a45f08530..48c9fa4a53 100644 --- a/src/web/service/proxy/proxy.ts +++ b/src/web/service/proxy/proxy.ts @@ -1,11 +1,12 @@ import * as URL from 'url'; import * as express from 'express'; import * as request from 'request'; +import * as isUrl from 'is-url'; module.exports = (req: express.Request, res: express.Response) => { const url = req.params.url; - if (!url) { + if (!url || !isUrl(url)) { return; } |