If the request is over SSL ...

... make sure to replace the URLs with https://instead of http:// to avoid mixed content warnings