relativize sometime outputs absolute paths whereas it should make use of dot segments. For example http://a/b/ relativized against http://a/b/c should return . and not /b/ and http://a/path/c relativized against http://a/path/foo/c should return ../c