this requires uri.isOpaque() to be false. Might be good to have a precondition for this.