Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom links with variables use improper URL encoding when spaces are included in the site name #12822

Closed
purgeitall opened this issue Jun 6, 2023 · 2 comments · Fixed by #12894
Assignees
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@purgeitall
Copy link

NetBox version

v3.5.3

Python version

3.10

Steps to Reproduce

  1. Create site with space in it - Example: "Test Site"
  2. Create custom link with content type "DCIM: Site".
  3. In the link url, use format: https://www.website.com/anything/{{object.name}}

Expected Behavior

When the link is selected, the variable should be replaced with "test site". proper URL encoding would look like this:

https://www.website.com/anything/test%20site

Observed Behavior

The link sends me to this URL which is what would be used when submitting a query. This may work for some URLs but with sharepoint all our links are now invalid.

https://www.website.com/anything/test+site

@purgeitall purgeitall added the type: bug A confirmed report of unexpected behavior in the application label Jun 6, 2023
@DanSheps
Copy link
Member

DanSheps commented Jun 6, 2023

According to @candlerb in this discussion: #12815 (comment)

This appears to be a bug, whether it is in our code or a library we use is the next question. If someone wants to take a crack at it. Feel free.

@DanSheps DanSheps added the status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation label Jun 6, 2023
@abhi1693 abhi1693 self-assigned this Jun 14, 2023
@abhi1693 abhi1693 added status: accepted This issue has been accepted for implementation and removed status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation labels Jun 14, 2023
@ibplayn
Copy link

ibplayn commented Jun 20, 2023

Could i suggest adding a semi-colon to safe string so that this:
https://website.com/dashboard?mode=device%3Bdevice_list=devicename

becomes this instead:
https://website.com/dashboard?mode=device;device_list=devicename

It was working on 3.4.X but seems to have broke in 3.5.2-4

Thanks!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants