Fix XDR protocol bug

Replace endpoint protocol with protocol used by the page
XDR cannot post to https from a page running on http