Skip to content

"getPath" function returns bad path when there is no trailing slash #829

@fncap

Description

@fncap

Sorry, but I cannot make a "reduced test case" due to a difficulty to create a test scenario.

I'm using an MVC approach so I have managed code on server side, and url are slugified, so I don't have file extensions.

In a webpage I've implemented a simple paging mechanism that use query string parameter, whenever an ajax GET is performed, managed code return HTML of desired page, and lastly following (for instance):
<a class="pagination__next" href="?p=2"></a>

so if actual URL path is something like /category/products, I'm expecting a GET like /category/products?p=2, instead I'm getting a GET like /gategory/?p=2 which is bad!

I think this issue is caused by getPath function that returns a substring until last '/' in URL's path.

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