Describe the bug
Plus (+) in hostnames are causing some URL crash.
To Reproduce
Steps to reproduce the behavior:
- add device with + in hostname (like hostname+routername+(test123+))
- Try to open /node/version?node_full=default/hostname+routername+(test123+)
Expected behavior
Get to the configs overview.
Fix
After some testing, I identified these files:
lib/oxidized/web/views/diffs.haml
lib/oxidized/web/views/nodes.haml
lib/oxidized/web/views/node.haml
Maybe there are more, but the relevant part in these files is @data[:full_name], which is not URL encoded. After changing it from @data[:full_name] to CGI.escape(@data[:full_name]) all the URLs for devices with + in the names are working.
I am pretty sure this is an super ugly fix, but one of you will for sure know the best location to implement this and provide a patch :). Please don't grill me, I am not an dev :).
Thank you!
best regards
JJ
Describe the bug
Plus (+) in hostnames are causing some URL crash.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Get to the configs overview.
Fix
After some testing, I identified these files:
lib/oxidized/web/views/diffs.haml
lib/oxidized/web/views/nodes.haml
lib/oxidized/web/views/node.haml
Maybe there are more, but the relevant part in these files is
@data[:full_name], which is not URL encoded. After changing it from@data[:full_name]toCGI.escape(@data[:full_name])all the URLs for devices with + in the names are working.I am pretty sure this is an super ugly fix, but one of you will for sure know the best location to implement this and provide a patch :). Please don't grill me, I am not an dev :).
Thank you!
best regards
JJ