Closed Pavinati closed 6 months ago
Why %252F
and not %2F
? How does this behave if you replace %2F
in both cases above?
Double encoding is used to avoid mistaking the /
in abc/xyz
as part of the path.
The fact that one query works on the other does not makes me think this was addressed in the past but not for every group query
The issue is that InterfaseValuesByGroupController
does not decode the group name like DeviceStatusByGroupController
does.
Easy fix: add that decoding. Better fix: scope all /groups
APIs and make a plug that fixes group_name
in a single place so we don't miss out on (potentially new) APIs there.
Marking this as Good first issue since it's quite trivial (also the test section of groups is not terrible so it's reasonable to also add a test for the fix to avoid regressions).
Steps to replicate:
/groups/abc%252Fxyz/devices
)/groups/abc%252Fxyz/devices/<device_id>/org.astarte-platform.genericsensors.Values
)Expected result
The device data
Actual result
{"errors":{"detail":"Device not found"}}