wocommunity/wonder — pull request #528 by hprange (2014-01-16 15:37:05+00:00)
Title: Use the correct protocol for S3 attachment URLs based on the request security level

**Problem**: the generated URL for S3 attachments always uses the HTTP protocol. In the context of secure requests (made over HTTPS), the generated URL should use the HTTPS protocol instead.

**Solution**: Chosing the URL protocol during persistence of the attachment is not ideal because the attachment may be used in secured and unsecured contexts later. The correct protocol should be determined during the URL generation. This patch replaces the HTTP protocol and removes the port (:80) from the generated URL whenever the request is secure.