[openstreetmap/openstreetmap-website] Prevent GPX trace upload form on website from violating API restrictions (Issue #3594)

Kai Michael Poppe notifications at github.com
Sun Jul 10 11:31:01 UTC 2022


### Description

As #1702 outlined (with a totally problem), the maximum length for the `description` value of a GPX track is 255 characters as per API restriction.

But, similar to StreetComplete (streetcomplete/streetcomplete#4195), the website does not restrict the maximum length of the input box. As the error message "is too long (maximum is 255 characters)" is only show after the user submits the form, the GPX file has already been completely transferred by the browser, only to be discarded because the API restrictions were violated.

Possible solution: Either use the slightly dated `maxlength` attribute on the `input` box or make a javascript check to not allow the form to be submitted if the description exceeds the maximum allowed characters.

If using a fixed value of 255 feels to static, adding that value in the GET /api/capabilities and using that as a reference for the input fields, should the datamodel ever be expanded (this could also be used for limits on the texts of Note Comments, if they exist).

Thoughts?

K

### Screenshots

_No response_

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/3594
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/issues/3594 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20220710/c1e46b64/attachment.htm>


More information about the rails-dev mailing list