Socket
Socket
Sign inDemoInstall

egg-cookies

Package Overview
Dependencies
15
Maintainers
5
Versions
35
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.8.2 to 2.8.3

13

lib/cookies.js

@@ -118,10 +118,14 @@ 'use strict';

const userAgent = this.ctx.get('user-agent');
let isSameSiteNone = false;
if (opts.sameSite && typeof opts.sameSite === 'string' && opts.sameSite.toLowerCase() === 'none') {
if (!this.secure || (userAgent && !this.isSameSiteNoneCompatible(userAgent))) {
isSameSiteNone = true;
if (opts.secure === false || !this.secure || (userAgent && !this.isSameSiteNoneCompatible(userAgent))) {
// Non-secure context or Incompatible clients, don't send SameSite=None property
opts.sameSite = false;
isSameSiteNone = false;
}
}
if (opts.partitioned) {
if (!this.secure || (userAgent && !this.isPartitionedCompatible(userAgent))) {
// allow to set partitioned: secure=true and sameSite=none and chrome >= 118
if (!isSameSiteNone || opts.secure === false || !this.secure || (userAgent && !this.isPartitionedCompatible(userAgent))) {
// Non-secure context or Incompatible clients, don't send partitioned property

@@ -186,6 +190,7 @@ opts.partitioned = false;

isPartitionedCompatible(userAgent) {
// Chrome >= 114.0.0.0
// support: Chrome >= 114.0.0.0
// default enable: Chrome >= 118.0.0.0
// https://developers.google.com/privacy-sandbox/3pcd/chips
const result = this._parseChromiumAndMajorVersion(userAgent);
if (result.chromium) return result.majorVersion >= 114;
if (result.chromium) return result.majorVersion >= 118;
return false;

@@ -192,0 +197,0 @@ }

{
"name": "egg-cookies",
"version": "2.8.2",
"version": "2.8.3",
"description": "cookies module for egg",

@@ -5,0 +5,0 @@ "files": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc