edekeijzer / OctoPrint-PSUControl-Shelly

GNU Affero General Public License v3.0
10 stars 6 forks source link

If the url specified in the "Address" contains a trailing slash '/', then the plugin creates an invalid url and the plugin doesn't appear to work #17

Open DanForever opened 1 year ago

DanForever commented 1 year ago

Describe the bug

Just cost me about 20 minutes trying to figure out why the plugin wasn't working. Turns out when I copied and pasted the URL from chrome into octoprint settings, it has a trailing forward slash, and it looks like you might not have any sort of sanitisation going on with the user input. This is just a minor thing, but it'd be nice for it to "just work" as it were

To Reproduce

Steps to reproduce the behavior:

  1. Go to PSU Control - Shelly settings
  2. Add a trailing slash to whatever address you have specified (for example, http://192.168.0.2 becomes http://192.168.0.2/

Expected behavior

It should work, but with a slash, it doesn't (the lightning bolt appears grey and seemingly disabled)

edekeijzer commented 1 year ago

Recently, #15 was proposed, which adds a remark to the help block to not include a trailing slash. I've just merged that one, but I'll take your request into account as well, as it is indeed quite a small modification.

DanForever commented 1 year ago

Further to this, I also noticed that you also need the http:// prefix as well for the plugin to function properly