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 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 (url.startsWith('https://') || url.startsWith('http://')) {
264
+ if (/^https?:\/\//i.test(url)) {
265
265
  // formatting url again avoid security escapes
266
266
  url = new URL(url).toString();
267
267
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koa",
3
- "version": "2.15.1",
3
+ "version": "2.15.2",
4
4
  "description": "Koa web app framework",
5
5
  "main": "lib/application.js",
6
6
  "exports": {