[Server] Fix bug
This commit is contained in:
		
							parent
							
								
									2801176dea
								
							
						
					
					
						commit
						4e9bb87d94
					
				
					 2 changed files with 4 additions and 1 deletions
				
			
		|  | @ -39,6 +39,7 @@ | ||||||
|     "@types/gulp-util": "3.0.30", |     "@types/gulp-util": "3.0.30", | ||||||
|     "@types/inquirer": "0.0.32", |     "@types/inquirer": "0.0.32", | ||||||
|     "@types/is-root": "1.0.0", |     "@types/is-root": "1.0.0", | ||||||
|  |     "@types/is-url": "1.2.28", | ||||||
|     "@types/js-yaml": "3.5.29", |     "@types/js-yaml": "3.5.29", | ||||||
|     "@types/mongodb": "2.1.36", |     "@types/mongodb": "2.1.36", | ||||||
|     "@types/ms": "0.7.29", |     "@types/ms": "0.7.29", | ||||||
|  | @ -95,6 +96,7 @@ | ||||||
|     "gulp-util": "3.0.8", |     "gulp-util": "3.0.8", | ||||||
|     "inquirer": "2.0.0", |     "inquirer": "2.0.0", | ||||||
|     "is-root": "1.0.0", |     "is-root": "1.0.0", | ||||||
|  |     "is-url": "1.2.2", | ||||||
|     "js-yaml": "3.7.0", |     "js-yaml": "3.7.0", | ||||||
|     "livescript": "1.5.0", |     "livescript": "1.5.0", | ||||||
|     "mime-types": "2.1.13", |     "mime-types": "2.1.13", | ||||||
|  |  | ||||||
|  | @ -1,11 +1,12 @@ | ||||||
| import * as URL from 'url'; | import * as URL from 'url'; | ||||||
| import * as express from 'express'; | import * as express from 'express'; | ||||||
| import * as request from 'request'; | import * as request from 'request'; | ||||||
|  | import * as isUrl from 'is-url'; | ||||||
| 
 | 
 | ||||||
| module.exports = (req: express.Request, res: express.Response) => { | module.exports = (req: express.Request, res: express.Response) => { | ||||||
| 	const url = req.params.url; | 	const url = req.params.url; | ||||||
| 
 | 
 | ||||||
| 	if (!url) { | 	if (!url || !isUrl(url)) { | ||||||
| 		return; | 		return; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue