Comments (2)
If you wish the create a fix, I will review and merge it.
from node-run-middleware.
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)
- Supports redirect HOT 1
- Add headers objects
- Can this be used with Router? HOT 3
- TypeError: Cannot read property 'pipesCount' of undefined HOT 11
- Small Error in Docs
- async/await usage HOT 2
- ERROR TypeError: Cannot read property 'remoteAddress' of undefined HOT 3
- setting HTTP status during SSR fails HOT 2
- mocking fetch to use node-run-middleware under the hood
- add typescript support
- node-run-middleware and helmet or cors = errors HOT 6
- Buffers / Stream
- .end() Doesn't work HOT 1
- Add an option to call to middleware by using req object HOT 1
- Lack of working res.getHeaders() breaks res.json() and some middleware. Possible fix suggestion. HOT 1
- Pre-population of req.cookies, which is inconsistent with Express, breaks popular "cookie-parse" middleware (PR fix inside)
- Disable the option to add as twice to the same app HOT 1
- Keep the headers and cookies from the current requests HOT 2
- Choose a better name and description HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-run-middleware.