only remove /websocket/ from path if it's present