Trailing slash is added elsewhere in the codebase, so here we remove it if present to avoid duplication