Skip to content

Commit eb84d89

Browse files
committed
fix: don't render redirect values in anchor ref
1 parent 5f294bb commit eb84d89

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

__tests__/response/redirect.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ describe('ctx.redirect(url)', () => {
8080
ctx.header.accept = 'text/html';
8181
ctx.redirect(url);
8282
assert.strictEqual(ctx.response.header['content-type'], 'text/html; charset=utf-8');
83-
assert.strictEqual(ctx.body, `Redirecting to <a href="${url}/">${url}/</a>.`);
83+
assert.strictEqual(ctx.body, `Redirecting to ${url}/.`);
8484
});
8585

8686
it('should escape the url', () => {
@@ -90,7 +90,7 @@ describe('ctx.redirect(url)', () => {
9090
ctx.redirect(url);
9191
url = escape(url);
9292
assert.strictEqual(ctx.response.header['content-type'], 'text/html; charset=utf-8');
93-
assert.strictEqual(ctx.body, `Redirecting to <a href="${url}">${url}</a>.`);
93+
assert.strictEqual(ctx.body, `Redirecting to ${url}.`);
9494
});
9595
});
9696

lib/response.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ module.exports = {
275275
if (this.ctx.accepts('html')) {
276276
url = escape(url);
277277
this.type = 'text/html; charset=utf-8';
278-
this.body = `Redirecting to <a href="${url}">${url}</a>.`;
278+
this.body = `Redirecting to ${url}.`;
279279
return;
280280
}
281281

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)