Fix XDR proticol bug

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