Fix: handle `baseUrl` with trailing slash in `fetch.getUrl` (#3455)
* tests
* tidy trailing slash in fetch.getUrl before forming url
* make sonar happy about Polynomial regular expression used on uncontrolled data
(cherry picked from commit ef1f5bf232c0b71c29e71cfa49f5e37683c4071f)