Giter Club home page Giter Club logo

Comments (8)

thomashohn avatar thomashohn commented on July 17, 2024 2

This PR might fix it or can be used for further fixes @keithamus - #317

from chai-http.

keithamus avatar keithamus commented on July 17, 2024 2

I'll close as this is resolved in #317 but we'll likely need to release this as breaking.

from chai-http.

crisward avatar crisward commented on July 17, 2024 1

Seems the tests don't pass when updating superagent to the latest version. Possibly related to this.

ladjs/superagent#1793

  2 failing

  1) assertions
       #cookie (agent):
     TypeError: Cannot read properties of undefined (reading 'push')
      at Agent.<computed> [as set] (node_modules/superagent/lib/agent-base.js:20:20)
      at Context.<anonymous> (test/http.js:378:13)
      at process.processImmediate (node:internal/timers:478:21)

  2) request
       Node.js
         agent can be used to persist cookies:
     TypeError: Cannot read properties of undefined (reading 'getCookies')
      at TestAgent._attachCookies (node_modules/superagent/lib/node/agent.js:75:30)
      at TestAgent.<computed> [as get] (lib/request.js:220:404)
      at Context.<anonymous> (test/request.js:192:10)
      at process.processImmediate (node:internal/timers:478:21)

from chai-http.

natlibfi-jonollil avatar natlibfi-jonollil commented on July 17, 2024

Dependabot cannot update formidable to a non-vulnerable version

The latest possible version that can be installed is 2.1.2 because of the following conflicting dependencies:

[email protected] requires formidable@^2.1.2 via [email protected]
No patched version available for formidable

The earliest fixed version is 3.2.4.

Dependabot note about this

from chai-http.

keithamus avatar keithamus commented on July 17, 2024

PRs welcome!

from chai-http.

43081j avatar 43081j commented on July 17, 2024

in chai-http in particular, i suspect its because superagent now wraps Agent in a proxy

so this line:

(Agent || Request).call(this);

doesn't do what it looks like it does. it looks like its trying to call the super constructor, but it will actually call superagent's Proxy function which returns the instance (i.e. it won't mutate this)

tbh maybe chai-http just needs a modernisation in a major release - turn all the prototypes into classes, etc

from chai-http.

crisward avatar crisward commented on July 17, 2024

turn all the prototypes into classes, etc

You may well be right. But to be honest, I just want to stop my npm install to stop yelling at me about 'critical' vulnerabilities. 😬

from chai-http.

43081j avatar 43081j commented on July 17, 2024

yeah i get that. unfortunately, superagent doesn't export the underlying Agent class for us to new up

they kinda borked things with that Proxy here:
https://github.com/ladjs/superagent/blob/b368f62b3d9beae564e8dca1eb1969fc7d10580e/src/node/agent.js#L102-L110

means it will new one up but unbound, i.e. not bound to thisArg

from chai-http.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.