The session response is of type bytes, so the replace() needs to use bytes, as well. But the text that's returned needs to be a string. Fixes GitLab issue #186