diff --git a/src/_handlers.ts b/src/_handlers.ts index e44e5dc7..6cdefd79 100644 --- a/src/_handlers.ts +++ b/src/_handlers.ts @@ -79,7 +79,7 @@ function defaultErrorHandler(err, req: express.Request, res: express.Response) { } } - res.end(`Error occured while trying to proxy: ${host}${req.url}`); + res.end(`Error occurred while trying to proxy: ${host}${req.url}`); } function logClose(req, socket, head) { diff --git a/test/unit/handlers.spec.ts b/test/unit/handlers.spec.ts index e8d5e195..22a8cfc1 100644 --- a/test/unit/handlers.spec.ts +++ b/test/unit/handlers.spec.ts @@ -119,7 +119,7 @@ describe('default proxy error handler', () => { it('should end the response and return error message', () => { proxyError(mockError, mockReq, mockRes, proxyOptions); - expect(errorMessage).toBe('Error occured while trying to proxy: localhost:3000/api'); + expect(errorMessage).toBe('Error occurred while trying to proxy: localhost:3000/api'); }); it('should not set the http status code to: 500 if headers have already been sent', () => { @@ -131,7 +131,7 @@ describe('default proxy error handler', () => { it('should end the response and return error message', () => { mockRes.headersSent = true; proxyError(mockError, mockReq, mockRes, proxyOptions); - expect(errorMessage).toBe('Error occured while trying to proxy: localhost:3000/api'); + expect(errorMessage).toBe('Error occurred while trying to proxy: localhost:3000/api'); }); it('should re-throw error from http-proxy when target is missing', () => {