question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HTTP in has the issues with the word "nodes"

See original GitHub issue

What are the steps to reproduce?

Use a flow with a simple HTTP in and out:

[{"id":"6f78693d.30cbe","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"a3ab74c8.9040e8","type":"template","z":"6f78693d.30cbe","name":"page","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<html>\n <head></head>\n <body>\n <h1>Hello test!</h1>\n </body>\n</html>","x":411,"y":134,"wires":[["c3aa0c54.7b304"]]},{"id":"1b578e3.25238f2","type":"http in","z":"6f78693d.30cbe","name":"","url":"/nodes/test","method":"get","upload":false,"swaggerDoc":"","x":219,"y":132,"wires":[["a3ab74c8.9040e8"]]},{"id":"c3aa0c54.7b304","type":"http response","z":"6f78693d.30cbe","name":"","x":551,"y":134,"wires":[]},{"id":"88747a07.964408","type":"template","z":"6f78693d.30cbe","name":"page","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<html>\n <head></head>\n <body>\n <h1>Hello test!</h1>\n </body>\n</html>","x":415,"y":214,"wires":[["a5dcda0f.e0ed28"]]},{"id":"2ae1cba7.f58a2c","type":"http in","z":"6f78693d.30cbe","name":"","url":"/nodes","method":"get","upload":false,"swaggerDoc":"","x":213,"y":212,"wires":[["88747a07.964408"]]},{"id":"a5dcda0f.e0ed28","type":"http response","z":"6f78693d.30cbe","name":"","x":555,"y":214,"wires":[]},{"id":"c0cc467c.5bd0b","type":"template","z":"6f78693d.30cbe","name":"page","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<html>\n <head></head>\n <body>\n <h1>Hello test!</h1>\n </body>\n</html>","x":437,"y":301,"wires":[["1cc8dc92.010463"]]},{"id":"180af91b.2e1fb7","type":"http in","z":"6f78693d.30cbe","name":"","url":"test/nodes","method":"get","upload":false,"swaggerDoc":"","x":246,"y":295,"wires":[["c0cc467c.5bd0b"]]},{"id":"1cc8dc92.010463","type":"http response","z":"6f78693d.30cbe","name":"","x":577,"y":301,"wires":[]},{"id":"b411785e.cc7fa8","type":"template","z":"6f78693d.30cbe","name":"page","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<html>\n <head></head>\n <body>\n <h1>Hello test!</h1>\n </body>\n</html>","x":426,"y":365,"wires":[["3c943598.ffc87a"]]},{"id":"9d4143bf.16c29","type":"http in","z":"6f78693d.30cbe","name":"","url":"test/nodes/test1","method":"get","upload":false,"swaggerDoc":"","x":254,"y":363,"wires":[["b411785e.cc7fa8"]]},{"id":"3c943598.ffc87a","type":"http response","z":"6f78693d.30cbe","name":"","x":566,"y":365,"wires":[]}]

What happens?

  • When only the word nodes is used in the URL a blank page is shown, regardless of the content which should be shown
  • When the word nodes is used in the URL at the beginning or somewhere in the middle between / / an error is shown { "code": "not_found", "message": "Error" }
  • When the word nodes is used in the URL at the end the expected content is shown

What do you expect to happen?

  • The word nodes should be treated as any other string in an URL and the expected content should be shown

Please tell us about your environment:

  • Node-RED version: 0.20.7
  • node.js version: 10.16.0
  • npm version: 6.9.0
  • Platform/OS: Darwin 18.6.0 x64 LE
  • Browser: Firefox

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
hardillbcommented, Jul 25, 2019

OK, I think I’ve found the problem.

Starting here: https://github.com/node-red/node-red/blob/8bb7b2e88b550ea05b2bfd58d9219ee7db44fe5a/packages/node_modules/%40node-red/editor-api/lib/admin/index.js#L52

These lines contain a regex that probably should have ^ at the start to stop it matching further down the path. I’ll try and find some time to stick in a pull request to fix it.

0reactions
hardillbcommented, Jul 23, 2019

Yep, that does look like it’s a problem. I can’t just off the top of my head find where the routes are set up just now. Might have to be one for Nick when he gets back from on holiday. Glad the workaround is working for now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolving problems when you use HTTP and SOAP nodes - IBM
Resolving problems when you use HTTP and SOAP nodes. Use the advice that is given here to help you to resolve common problems...
Read more >
Node-Red Web Server -HTTP-IN and HTTP Response Nodes
Hi Steve, I'm working on creating a page using the Http and Template nodes. On this page I have a table, in which...
Read more >
[Bug] not working at node 17 · Issue #705 · chimurai/http-proxy ...
Describe the bug (be clear and concise)​​ use the library to proxy into another service. not working when upgraded to node 17.
Read more >
Problems with a specific request from an HTTP Request Node
Hi all! It seems that we have a problem with the HTTP Request node in the way it sends requests. I have to...
Read more >
No 'Access-Control-Allow-Origin' - Node / Apache Port Issue
I tried using node-http-proxy and Vhosts Apache but not having much succes, please see full error and code below.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found