HTTP Request response changed 0.20.2 upgrade

#1

Hi All,
I have just gone from NR 0.18.2 to 0.20.2 on my Home automation test bed running on a RPI.
The http link to my Daikin ducted AC stopped working. Really simple > Inject to HTTP Request and debug node. This has been working now for weeks. At first I checked out the Daikin wifi unit suspecting it had fallen over. I then pasted the url directly into a web browser and the correct response was returned which I have been getting from the HTTP Request till now.

ret=OK,sta=2,cur=2019/3/21 20:19:58,reg=au,dst=1,zone=345

From the debug node after the upgrade I get.

_msgid: "133c03c7.51762c"
topic: ""
payload: ""
statusCode: 403
headers: object
responseUrl: "http://192.168.1.22:80/skyfi/common/get_datetime"
redirectList: array[0]

During the upgrade I also upgraded the general OS apt-get update and upgrade just to bring the system upto date.

Code is below.

[{"id":"ac98d615.493908","type":"debug","z":"ba04ec5b.44317","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":590,"y":260,"wires":},{"id":"8e5ce68f.844258","type":"inject","z":"ba04ec5b.44317","name":"","topic":"","payload":"http://192.168.1.22/skyfi/common/get_datetime","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":260,"wires":[["c791b449.64f9c8"]]},{"id":"c791b449.64f9c8","type":"http request","z":"ba04ec5b.44317","name":"","method":"GET","ret":"txt","paytoqs":false,"url":"http://192.168.1.22:80/skyfi/common/get_datetime","tls":"","proxy":"","x":370,"y":260,"wires":[["ac98d615.493908"]]}]

0 Likes

#2

Please edit your post above and format your code correctly, otherwise it will be difficult to help. See How to share code or flow json

0 Likes

#3

is forbidden from the server end... do you have the correct user/pwd - credentials in place.

0 Likes

#4

Sorry about that not sure what happend @Paul-Reed

[{"id":"ac98d615.493908","type":"debug","z":"ba04ec5b.44317","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":590,"y":260,"wires":[]},{"id":"8e5ce68f.844258","type":"inject","z":"ba04ec5b.44317","name":"","topic":"","payload":"http://192.168.1.22/skyfi/common/get_datetime","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":260,"wires":[["c791b449.64f9c8"]]},{"id":"c791b449.64f9c8","type":"http request","z":"ba04ec5b.44317","name":"","method":"GET","ret":"txt","paytoqs":false,"url":"http://192.168.1.22:80/skyfi/common/get_datetime","tls":"","proxy":"","x":370,"y":260,"wires":[["ac98d615.493908"]]}]

@dceejay No security on the device at all. What has me stumped the URL work fine in every browser I have tried even on the same machine. It is like the is a different in the message structure a browser uses and HTTP request uses.

0 Likes

#5

This is a Wireshark trace of the Browser Request which returns correctly

This is the Node Red Request which fails

Not sure how to add the addition browser properties to the HTTP Request to get it working. I will then remove them one by one to find the offender. BTW this test was done a entirely different VM machine with NR 0.19.5 so it not a 0.20.2 version issue. Keep in mind this did work on 0.18.2

0 Likes

#6

Ok, Worked out how to make the request function look identical to the Browser request. But no luck the Http request is still return 403.
Just tried from the terminal
"curl http://192.168.1.22/skyfi/common/get_datetime" all good responded correctly.
Any ideas.

0 Likes

#7

OK most likely my last post on this topic, unless someone has any better ideas. Ran Curl from the exec node and it return the correct string.

0 Likes

#8

For others finding this thread the cookbook includes an example of how to add http headers

https://cookbook.nodered.org

0 Likes