hmm, does this method for transporting the protocol work on all browsers? Am probably just being neckbeardy but expect this to fail somewhere.  The transport protocol should be available as part of the sinatra provided server variables and we could just use that here to produce correct full urls?