Inconsistency in svg return from api #6551

Closed
opened 2025-12-29 19:42:14 +01:00 by adam · 2 comments
Owner

Originally created by @ekrichbaum on GitHub (Jun 9, 2022).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.2.4

Python version

3.10

Steps to Reproduce

1.) call api for rackface elevation (from different machine).
https://netbox.mydomain.com/api/dcim/racks/33/elevation/?face=front&render=svg&unit_width=220&unit_height=22&legend_width=30&expand_devices=true&include_images=true
where 33 is the id of the rack to generate.
2.) view source on the returned rackface.

Expected Behavior

All references should return full url. Different machine fails on relative links to display graphics.

Observed Behavior

Some link elements are represented with full url.

a fill="black" target="_top" xlink:href="https://netbox.mydomain.com/dcim/devices/89/"

others are returned with partial.

a target="_top" xlink:href="/dcim/devices/add/?site=3&location=&rack=33&face=front&position=27"

As a workaround, I parsed the return and did a string replace to fill in the missing info.

Originally created by @ekrichbaum on GitHub (Jun 9, 2022). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.2.4 ### Python version 3.10 ### Steps to Reproduce 1.) call api for rackface elevation (from different machine). https://netbox.mydomain.com/api/dcim/racks/33/elevation/?face=front&render=svg&unit_width=220&unit_height=22&legend_width=30&expand_devices=true&include_images=true where 33 is the id of the rack to generate. 2.) view source on the returned rackface. ### Expected Behavior All references should return full url. Different machine fails on relative links to display graphics. ### Observed Behavior Some link elements are represented with full url. `a fill="black" target="_top" xlink:href="https://netbox.mydomain.com/dcim/devices/89/"` others are returned with partial. `a target="_top" xlink:href="/dcim/devices/add/?site=3&location=&rack=33&face=front&position=27"` As a workaround, I parsed the return and did a string replace to fill in the missing info.
adam added the type: bugstatus: accepted labels 2025-12-29 19:42:14 +01:00
adam closed this issue 2025-12-29 19:42:14 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jun 9, 2022):

Please revise your description above to indicate exactly which element(s) you believe are affected.

@jeremystretch commented on GitHub (Jun 9, 2022): Please revise your description above to indicate exactly which element(s) you believe are affected.
Author
Owner

@ekrichbaum commented on GitHub (Jun 10, 2022):

devicetype-images are relative. "add" links are relative. device links are absolute. My preference would be absolute links across the board, but all one way or the other is workable.

@ekrichbaum commented on GitHub (Jun 10, 2022): devicetype-images are relative. "add" links are relative. device links are absolute. My preference would be absolute links across the board, but all one way or the other is workable.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6551