Skip to content

Path normalisation/Stripping leading slashes #533

@ColinHebert

Description

@ColinHebert

Is your feature request related to a problem? Please describe.
When working with a relatively naive setup of gotify, one may have a trailing slash when specifying the url of the host (http://localhost/ instead of http://localhost for example).
To avoid any issues/ambiguity, the developer using this URL should append /message to the configured url to send a message regardless of the url specified by the customer to ensure that a slash is in there.

This can lead to the fully formed looking like this http://localhost//mesage, unfortunately with the way gotify is currently built, the double slash is not normalised and a query at this URL will lead to a 404

Describe the solution you'd like
Gotify should normalise the URL it receives to deduplicate slashes when possible, those are not meant to have any bearing on the URL.

Describe alternatives you've considered
The alternative is to leave with misconfigurations and hope they are being detected early on by the API user.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions