diff options
author | Louise Crow <louise.crow@gmail.com> | 2014-02-17 13:22:44 +0000 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2014-02-17 13:22:44 +0000 |
commit | 596bc6e362554dc6d041a15ecfd5d1627deab3d0 (patch) | |
tree | 221968261207a6e8e5ed0a55c0747ffa2ed401c7 | |
parent | 241ced50fa187ae24c183d91cd78dd60dd014547 (diff) |
Use HTTPS Google docs viewer where using HTTPS for alaveteli
-rw-r--r-- | app/models/foi_attachment.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/foi_attachment.rb b/app/models/foi_attachment.rb index acbfc8a34..ecd4a1872 100644 --- a/app/models/foi_attachment.rb +++ b/app/models/foi_attachment.rb @@ -359,7 +359,8 @@ class FoiAttachment < ActiveRecord::Base ret = "<html><head></head><body>"; if self.has_google_docs_viewer? wrapper_id = "wrapper_google_embed" - ret = ret + "<iframe src='http://docs.google.com/viewer?url=<attachment-url-here>&embedded=true' width='100%' height='100%' style='border: none;'></iframe>"; + protocol = AlaveteliConfiguration::force_ssl ? 'https' : 'http' + ret = ret + "<iframe src='#{protocol}://docs.google.com/viewer?url=<attachment-url-here>&embedded=true' width='100%' height='100%' style='border: none;'></iframe>"; else ret = ret + "<p>Sorry, we were unable to convert this file to HTML. Please use the download link at the top right.</p>" end |