| 24 | describe('With Security Related Issues', () => { |
| 25 | it.skip('should handle invalid URL properly', async () => { |
| 26 | async function invalidRequest() { |
| 27 | return new Promise((resolve, reject) => { |
| 28 | const request = http.request( |
| 29 | { |
| 30 | hostname: `localhost`, |
| 31 | port: next.appPort, |
| 32 | path: `*`, |
| 33 | }, |
| 34 | (response) => { |
| 35 | resolve(response.statusCode) |
| 36 | } |
| 37 | ) |
| 38 | request.on('error', (err) => reject(err)) |
| 39 | request.end() |
| 40 | }) |
| 41 | } |
| 42 | try { |
| 43 | expect(await invalidRequest()).toBe(400) |
| 44 | expect(await invalidRequest()).toBe(400) |