Yeah sure... I can change the code using that approach. Will have another look at that. Even through it would of course not be possible for 'someone' to pass in a path starting with '///foo' as we are talking about code that is committed and merged into this repo, so it will be reviews and checkend I may assume ;)

The only issue I currently see  is that the api endpoints are not defined consistently. Sometimes they start with a slash and sometimes they don't.

But no problem, I will use your suggested approach and update the PR accordingly, also adding some unit tests...