Skip to content

Commit 674d926

Browse files
authored
fix: add prefix for invalidate endpoint (#2571)
1 parent 768ced4 commit 674d926

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

lib/utils/routes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function routes(server) {
2222
createReadStream(join(clientBasePath, 'default/index.bundle.js')).pipe(res);
2323
});
2424

25-
app.get('/invalidate', (_req, res) => {
25+
app.get('/webpack-dev-server/invalidate', (_req, res) => {
2626
server.invalidate();
2727
res.end();
2828
});

test/server/utils/routes.test.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,12 @@ describe('routes util', () => {
4848
});
4949
});
5050

51-
it('GET request to invalidate endpoint', (done) => {
52-
req.get('/invalidate').expect(200, done);
51+
it('should handles GET request to invalidate endpoint', (done) => {
52+
req.get('/webpack-dev-server/invalidate').then(({ res }) => {
53+
expect(res.headers['content-type']).not.toEqual('text/html');
54+
expect(res.statusCode).toEqual(200);
55+
done();
56+
});
5357
});
5458

5559
it('should handles GET request to live html', (done) => {

0 commit comments

Comments
 (0)