improved xhr patch to not include body if none given; fixed bug in peer uri parsing