Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

http-cookie-agent

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-cookie-agent - npm Package Compare versions

Comparing version 2.1.0 to 2.1.1

8

dist/create_cookie_agent.js

@@ -51,3 +51,3 @@ "use strict";

if (cookie === undefined) {
if (cookie == null) {
continue;

@@ -71,3 +71,3 @@ }

if (req._header === null) {
if (req._header == null) {
req.setHeader('Cookie', cookieHeader);

@@ -91,3 +91,3 @@ return;

if (firstChunk === undefined) {
if (firstChunk == null) {
return;

@@ -120,3 +120,3 @@ }

if (cookies !== undefined) {
if (cookies != null) {
for (const cookie of cookies) {

@@ -123,0 +123,0 @@ await this.jar.setCookie(cookie, requestUrl, {

@@ -26,5 +26,5 @@ "use strict";

function createCookieClient(BaseAgentClass) {
function createCookieClient(BaseClientClass) {
// @ts-expect-error ...
class CookieClient extends BaseAgentClass {
class CookieClient extends BaseClientClass {
constructor(url, {

@@ -31,0 +31,0 @@ cookies: cookieOpts,

{
"name": "http-cookie-agent",
"version": "2.1.0",
"version": "2.1.1",
"description": "Allows cookies with every Node.js HTTP clients.",

@@ -71,3 +71,3 @@ "keywords": [

"devDependencies": {
"@3846masa/configs": "github:3846masa/configs",
"@3846masa/configs": "github:3846masa/configs#a45bbd3e20a59f0c83aef18648144d8f04884f9b",
"@babel/cli": "^7.17.10",

@@ -92,3 +92,2 @@ "@babel/core": "7.17.10",

"deasync": "0.1.26",
"eslint-import-resolver-typescript": "2.7.1",
"got": "12.0.4",

@@ -95,0 +94,0 @@ "http-proxy": "1.18.1",

@@ -0,4 +1,5 @@

import type { CookieJar } from 'tough-cookie';
import type { Agent, Client } from 'undici';
interface CookieOptions {
export interface CookieOptions {
async_UNSTABLE?: true;

@@ -8,3 +9,3 @@ jar: CookieJar;

namespace CookieAgent {
export namespace CookieAgent {
export interface Options extends Agent.Options {

@@ -15,7 +16,7 @@ cookies?: CookieOptions | undefined;

class CookieAgent extends Agent {
constructor(options: CookieAgent.Options = {});
export class CookieAgent extends Agent {
constructor(options?: CookieAgent.Options);
}
namespace CookieClient {
export namespace CookieClient {
export interface Options extends Client.Options {

@@ -26,10 +27,8 @@ cookies?: CookieOptions | undefined;

class CookieClient extends Client {
export class CookieClient extends Client {
constructor(url: string | URL, options?: CookieClient.Options);
}
function createCookieClient<BaseClient extends Client = Client, BaseClientOptions = unknown>(
BaseClient: new (origin: URL, options: BaseClientOptions) => BaseClient,
): new (origin: URL, options: BaseClientOptions & { cookies?: CookieOptions | undefined }) => CookieAgent<BaseAgent>;
export { CookieAgent, CookieClient, createCookieClient };
export function createCookieClient<BaseClient extends Client = Client, BaseClientOptions = unknown>(
BaseClientClass: new (origin: string | URL, options: BaseClientOptions) => BaseClient,
): new (origin: string | URL, options?: BaseClientOptions & { cookies?: CookieOptions | undefined }) => BaseClient;
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc