Comment on attachment 272460[details][diff][review]
Slightly better
+ mAuthority.mLen += start - mPath.mPos;
I think it would be clearer if you wrote this as:
mAuthority.mLen -= mPath.mPos - start;
perhaps store that length in a temp. var even and pass that to Cut and -=

Created attachment 272596[details][diff][review]
Updated to comments
I made that code read:
// need to remove the port number from the URL spec
PRUint32 start = mHost.mPos + mHost.mLen;
PRUint32 lengthToCut = mPath.mPos - start;
mSpec.Cut(start, lengthToCut);
mAuthority.mLen -= lengthToCut;
ShiftFromPath(-lengthToCut);
I think we should take this on branch; right now if a principal's URI gets SetPort called on it somewhere along the way, the principals origin will actually be wrong.