Use same protocol to get the resources as the site is being requested.

This fixes the problem with some resources being fetched using http when the user is connected with https.