mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Preserve querystring when ensuring path ends with slash
This commit is contained in:
@@ -39,6 +39,19 @@ describe("ui api", function() {
|
||||
.get('/foo')
|
||||
.expect(301,done);
|
||||
});
|
||||
it('redirects if the path, with query string, does not end in a slash',function(done) {
|
||||
request(app)
|
||||
.get('/foo?abc=def')
|
||||
.expect(301)
|
||||
.end(function(err,res) {
|
||||
if (err) {
|
||||
return done(err);
|
||||
}
|
||||
res.header['location'].should.equal("/foo/?abc=def");
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('does not redirect if the path ends in a slash',function(done) {
|
||||
request(app)
|
||||
.get('/foo/')
|
||||
|
Reference in New Issue
Block a user