diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-01-07 20:20:30 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-01-07 20:20:30 +0900 |
| commit | d69a6f0fb1cbb01793063bd8a6915856f92d7e0d (patch) | |
| tree | 1b453864557f2b1a320dbd96cd768c9aac136856 /src/web | |
| parent | [Server] Fix bug (diff) | |
| download | sharkey-d69a6f0fb1cbb01793063bd8a6915856f92d7e0d.tar.gz sharkey-d69a6f0fb1cbb01793063bd8a6915856f92d7e0d.tar.bz2 sharkey-d69a6f0fb1cbb01793063bd8a6915856f92d7e0d.zip | |
Refactor: Improve readability
Diffstat (limited to 'src/web')
| -rw-r--r-- | src/web/service/proxy/proxy.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/web/service/proxy/proxy.ts b/src/web/service/proxy/proxy.ts index 97755a0037..7a1a92fef2 100644 --- a/src/web/service/proxy/proxy.ts +++ b/src/web/service/proxy/proxy.ts @@ -1,16 +1,16 @@ -import * as url from 'url'; +import * as URL from 'url'; import * as express from 'express'; import * as request from 'request'; module.exports = (req: express.Request, res: express.Response) => { - const _url = req.params.url; + const url = req.params.url; - if (!_url) { + if (!url) { return; } request({ - url: _url + (url.parse(req.url, true).search || ''), + url: url + (URL.parse(req.url, true).search || ''), encoding: null }, (err, response, content) => { if (err) { |