[openstreetmap/openstreetmap-website] [API] Can not GET/DELETE a preference with a dot in its name. Ex: (Issue #5004)
Binnette
notifications at github.com
Fri Jul 19 12:32:59 UTC 2024
### URL
https://api.openstreetmap.org/api/0.6/user/preferences/diary.default_language
### How to reproduce the issue?
1. List your preferences: `curl -X GET -H "Authorization: Bearer $Token" https://api.openstreetmap.org/api/0.6/user/preferences/ -w "\n%{http_code}\n"`
````
<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6" generator="OpenStreetMap server" copyright="OpenStreetMap and contributors" attribution="http://www.openstreetmap.org/copyright" license="http://opendatacommons.org/licenses/odbl/1-0/">
<preferences>
<preference k="diary.default_language" v="en"/>
<preference k="gps.trace.visibility" v="identifiable"/>
<preference k="nbInvalid" v="-1"/>
<preference k="nbValid" v="-1"/>
</preferences>
</osm>
200
````
2. It works and return http status code 200
3. Get preference without dot in name: `curl -X GET -H "Authorization: Bearer $Token" https://api.openstreetmap.org/api/0.6/user/preferences/nbValid -w "\n%{http_code}\n"`
````
-1
200
````
4. It works and return -1 (nbValid value) and http status code 200
5. Get preference without dot in name: `curl -X GET -H "Authorization: Bearer $Token" https://api.openstreetmap.org/api/0.6/user/preferences/diary.default_language -w "\n%{http_code}\n"`
````
404
````
6. It does not work. Returns empty and 404
### Screenshot(s) or anything else?
_No response_
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/5004
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/issues/5004 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240719/5c53e3e6/attachment.htm>
More information about the rails-dev
mailing list