GithubHelp home page GithubHelp logo

Comments (2)

Aminadav avatar Aminadav commented on July 24, 2024

If you wish the create a fix, I will review and merge it.

from node-run-middleware.

customautosys avatar customautosys commented on July 24, 2024

Facing same problem due to undefined content-type. I tried to add a content-type to the headers in createRes but that didn't work either. Also I'm having a problem where the IP cannot be passed to the other middleware that I'm calling even though I have passed in {ip:...} in the options of runMiddleware.

TypeError: Cannot read properties of undefined (reading 'startsWith')
    at getIPFromReq (/home/walfin/Dokumentujo/Gitlab/quasar_upgrade/caswebsite/node_modules/directus/dist/utils/get-ip-from-req.js:22:15)
    at handler (/home/walfin/Dokumentujo/Gitlab/quasar_upgrade/caswebsite/node_modules/directus/dist/middleware/authenticate.js:25:48)
    at /home/walfin/Dokumentujo/Gitlab/quasar_upgrade/caswebsite/node_modules/directus/dist/utils/async-handler.js:3:66
    at Layer.handle [as handle_request] (/home/walfin/Dokumentujo/Gitlab/quasar_upgrade/caswebsite/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/home/walfin/Dokumentujo/Gitlab/quasar_upgrade/caswebsite/node_modules/express/lib/router/index.js:328:13)
    at /home/walfin/Dokumentujo/Gitlab/quasar_upgrade/caswebsite/node_modules/express/lib/router/index.js:286:9
    at Function.process_params (/home/walfin/Dokumentujo/Gitlab/quasar_upgrade/caswebsite/node_modules/express/lib/router/index.js:346:12)
    at next (/home/walfin/Dokumentujo/Gitlab/quasar_upgrade/caswebsite/node_modules/express/lib/router/index.js:280:10)
    at extractToken (/home/walfin/Dokumentujo/Gitlab/quasar_upgrade/caswebsite/node_modules/directus/dist/middleware/extract-token.js:30:5)
    at Layer.handle [as handle_request] (/home/walfin/Dokumentujo/Gitlab/quasar_upgrade/caswebsite/node_modules/express/lib/router/layer.js:95:5)
node:_http_outgoing:654
  const entry = headers[StringPrototypeToLowerCase(name)];
                       ^

TypeError: Cannot read properties of undefined (reading 'content-type')
    at ServerResponse.getHeader (node:_http_outgoing:654:24)
    at ServerResponse.res.get (/home/walfin/Dokumentujo/Gitlab/quasar_upgrade/caswebsite/node_modules/express/lib/response.js:812:15)
    at ServerResponse.json (/home/walfin/Dokumentujo/Gitlab/quasar_upgrade/caswebsite/node_modules/express/lib/response.js:274:13)
    at /home/walfin/Dokumentujo/Gitlab/quasar_upgrade/caswebsite/node_modules/directus/dist/middleware/error-handler.js:93:20
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

from node-run-middleware.

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.