You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.expect(302,'<p>Found. Redirecting to <a href="http://google.com">http://google.com</a></p>',done)
109
+
.expect(302,'<p>Found. Redirecting to http://google.com</p>',done)
110
110
})
111
111
112
112
it('should escape the url',function(done){
@@ -122,9 +122,27 @@ describe('res', function(){
122
122
.set('Accept','text/html')
123
123
.expect('Content-Type',/html/)
124
124
.expect('Location','%3Cla\'me%3E')
125
-
.expect(302,'<p>Found. Redirecting to <a href="%3Cla'me%3E">%3Cla'me%3E</a></p>',done)
125
+
.expect(302,'<p>Found. Redirecting to %3Cla'me%3E</p>',done)
126
126
})
127
127
128
+
it('should not render evil javascript links in anchor href (prevent XSS)',function(done){
.expect(301,'<p>Moved Permanently. Redirecting to <a href="http://google.com">http://google.com</a></p>',done);
158
+
.expect(301,'<p>Moved Permanently. Redirecting to http://google.com</p>',done);
0 commit comments