Skip to content

Commit

Permalink
Add test for redirection of URLs with query parts
Browse files Browse the repository at this point in the history
  • Loading branch information
17320 committed Oct 5, 2018
1 parent 7f87ef0 commit 5b077c7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,15 @@ describe('server', function() {
});
});

it('preserve query part after appending trailing slash', function() {
return Promise.using(prepareServer(), function(app) {
return request(app).get('/foo?x=y')
.expect('Location', '/foo/?x=y')
.expect(302, 'Redirecting')
.end();
});
});

it('don\'t append trailing slash if URL has a extension name', function() {
return Promise.using(prepareServer(), function(app) {
return request(app).get('/bar.txt')
Expand Down

0 comments on commit 5b077c7

Please sign in to comment.