You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

koa

Package Overview
Dependencies
Maintainers
11
Versions
123
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa - npm Package Compare versions

Comparing version
2.16.1
to
2.16.2
+20
-1
lib/response.js

@@ -243,2 +243,18 @@

_getBackReferrer() {
const referrer = this.ctx.get('Referrer');
if (referrer) {
// referrer is a relative path
if (referrer.startsWith('/')) {
return referrer;
}
// referrer is an absolute URL, check if it's the same origin
const url = new URL(referrer, this.ctx.href);
if (url.host === this.ctx.host) {
return referrer;
}
}
},
/**

@@ -265,3 +281,6 @@ * Perform a 302 redirect to `url`.

// location
if ('back' === url) url = this.ctx.get('Referrer') || alt || '/';
if ('back' === url) {
url = this._getBackReferrer() || alt || '/';
}
if (/^https?:\/\//i.test(url)) {

@@ -268,0 +287,0 @@ // formatting url again avoid security escapes

{
"name": "koa",
"version": "2.16.1",
"version": "2.16.2",
"publishConfig": {
"access": "public",
"tag": "latest-2"
},
"description": "Koa web app framework",

@@ -5,0 +9,0 @@ "main": "lib/application.js",