Skip to content

Similarly named parameters causing incorrect endpoint binding #16

Open
@Exanlv

Description

@Exanlv

'something/:thing/:thing_other' with the following bindings ['::thing::', '::thing other::'] produces something/::thing::/::thing::_other rather than something/::thing::/::thing other::

This is caused by the str_replace replacing the :thing part of :thing_other as well, few fixes I can think of:

  1. Requiring params to also have an ending :, instead of :guild_id it'd be :guild_id: (breaking change for users who specify their own endpoints manually instead of using the constants)
  2. Dont replace :guild_id, instead replace :guild_id/ AND /:guild_id with the appropriate param, not breaking
  3. Setting a priority to params to replace, in the example provided :thing_other would get higher priority and be replaced first. This would still allow weird replacements when you use $onlyMajorParameters but it wouldnt cause issues for the rate limiting buckets as it's consistently weird

Currently, there's no endpoints for Discord that would run into this issue. Low priority.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions