From 0578af0c4ce5fd8ebdc3a266888bc9c09117e8bf Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Mon, 16 Feb 2015 14:59:40 +0100 Subject: [PATCH] Don't set default avatar url on ENV Fingerprinting filter that Brocolli uses to add checksums to filenames apparently is very greedy. When a URL that has a valid image is present in ENV, fingerprint filter will going to wipe out the entire config's meta tag value with fingerprinted url with an asset host. --- app/utils/urls.coffee | 3 ++- config/environment.js | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/utils/urls.coffee b/app/utils/urls.coffee index 76fe7901..6f91752e 100644 --- a/app/utils/urls.coffee +++ b/app/utils/urls.coffee @@ -39,6 +39,7 @@ email = (email) -> "mailto:#{email}" gravatarImage = (email, size) -> - "https://www.gravatar.com/avatar/#{md5(email)}?s=#{size}&d=#{encodeURIComponent(config.avatarDefaultUrl)}" + avatarDefaultUrl = 'https://travis-ci.org/images/ui/default-avatar.png' + "https://www.gravatar.com/avatar/#{md5(email)}?s=#{size}&d=#{encodeURIComponent(avatarDefaultUrl)}" `export { plainTextLog, githubPullRequest, githubCommit, githubRepo, githubWatchers, githubNetwork, githubAdmin, statusImage, ccXml, email, gravatarImage }` diff --git a/config/environment.js b/config/environment.js index e099cd8b..2b873c01 100644 --- a/config/environment.js +++ b/config/environment.js @@ -28,8 +28,7 @@ module.exports = function(environment) { pro: false, enterprise: false, endpoints: {}, - intervals: { updateTimes: 1000 }, - avatarDefaultUrl: 'https://travis-ci.org/images/ui/default-avatar.png' + intervals: { updateTimes: 1000 } }; if (typeof process !== 'undefined') {