Skip to content

Plus (+) in hostnames causes non working URLs #414

Description

@jjaritsch

Describe the bug
Plus (+) in hostnames are causing some URL crash.

To Reproduce
Steps to reproduce the behavior:

  1. add device with + in hostname (like hostname+routername+(test123+))
  2. 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions