Skip to content

Commit f999d1c

Browse files
authored
fix(_handlers.ts): typo (#655)
* Fix a typo in _handlers.ts * Fix a typo in handlers.spec.ts
1 parent aca648f commit f999d1c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/_handlers.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ function defaultErrorHandler(err, req: express.Request, res: express.Response) {
7979
}
8080
}
8181

82-
res.end(`Error occured while trying to proxy: ${host}${req.url}`);
82+
res.end(`Error occurred while trying to proxy: ${host}${req.url}`);
8383
}
8484

8585
function logClose(req, socket, head) {

test/unit/handlers.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ describe('default proxy error handler', () => {
119119

120120
it('should end the response and return error message', () => {
121121
proxyError(mockError, mockReq, mockRes, proxyOptions);
122-
expect(errorMessage).toBe('Error occured while trying to proxy: localhost:3000/api');
122+
expect(errorMessage).toBe('Error occurred while trying to proxy: localhost:3000/api');
123123
});
124124

125125
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', () => {
131131
it('should end the response and return error message', () => {
132132
mockRes.headersSent = true;
133133
proxyError(mockError, mockReq, mockRes, proxyOptions);
134-
expect(errorMessage).toBe('Error occured while trying to proxy: localhost:3000/api');
134+
expect(errorMessage).toBe('Error occurred while trying to proxy: localhost:3000/api');
135135
});
136136

137137
it('should re-throw error from http-proxy when target is missing', () => {

0 commit comments

Comments
 (0)