koa 2.15.1 → 2.15.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/History.md +6 -0
- package/lib/response.js +1 -1
- package/package.json +1 -1
package/History.md
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
|
|
2
|
+
2.15.2 / 2024-03-21
|
|
3
|
+
==================
|
|
4
|
+
|
|
5
|
+
**fixes**
|
|
6
|
+
* [[`94e8def`](http://github.com/koajs/koa/commit/94e8def4bf6a2bdabe96583de989f03d75106648)] - fix: handle upper case protocol like HTTP or HTTPS (#1806) (fengmk2 <<suqian.yf@antgroup.com>>)
|
|
7
|
+
|
|
2
8
|
2.15.1 / 2024-03-15
|
|
3
9
|
==================
|
|
4
10
|
|
package/lib/response.js
CHANGED
|
@@ -261,7 +261,7 @@ module.exports = {
|
|
|
261
261
|
redirect(url, alt) {
|
|
262
262
|
// location
|
|
263
263
|
if ('back' === url) url = this.ctx.get('Referrer') || alt || '/';
|
|
264
|
-
if (
|
|
264
|
+
if (/^https?:\/\//i.test(url)) {
|
|
265
265
|
// formatting url again avoid security escapes
|
|
266
266
|
url = new URL(url).toString();
|
|
267
267
|
}
|