The version here adds a unit test, and patches URLResolver per prior feedback (which had failed to make it into the public version of the patch's r2).