algorithm in the RFC treats the empty basepath edge case differently for URIs with and without an authority section, which is why the third argument is necessary. r