Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Fixes #5223 - Settings page fails to display account avatar
Browse files Browse the repository at this point in the history
  • Loading branch information
punamdahiya committed Nov 29, 2018
1 parent 41df3a6 commit ee63fd4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions server/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ const conf = convict({
env: "FXA_CLIENT_SECRET",
arg: "fxa-client-secret",
},
profileImageServer: {
doc: "Firefox Account user avatar url",
format: String,
default: "https://firefoxusercontent.com",
env: "FXA_PROFILE_IMAGE_URI",
arg: "fxa-profile-image-uri",
},
},
db: {
user: {
Expand Down
3 changes: 2 additions & 1 deletion server/src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ const SITE_CDN = (config.siteCdn && (new URL(config.siteCdn)).host) || "";
const CONTENT_NAME = config.contentOrigin || "";
const CONTENT_CDN = (config.contentCdn && (new URL(config.contentCdn)).host) || "";
const FXA_SERVER = config.fxa.profileServer && require("url").parse(config.fxa.profileServer).host;
const FXA_USER_CONTENT = config.fxa.profileImageServer || "";

function addHSTS(req, res) {
// Note: HSTS will only produce warning on a localhost self-signed cert
Expand Down Expand Up @@ -1220,7 +1221,7 @@ app.use((req, res, next) => {
if (!DO_NOT_SEND_CSP) {
res.header(
"Content-Security-Policy",
`default-src 'self'; img-src 'self' ${FXA_SERVER} www.google-analytics.com ${SITE_CDN} ${CONTENT_CDN} ${CONTENT_NAME} data:; script-src 'self' ${SITE_CDN} www.google-analytics.com 'nonce-${uuid}'; style-src 'self' ${SITE_CDN} 'unsafe-inline' https://code.cdn.mozilla.net; connect-src 'self' ${SITE_CDN} ${CONTENT_CDN} www.google-analytics.com ${dsn}; font-src https://code.cdn.mozilla.net; frame-ancestors 'none'; object-src 'none';`);
`default-src 'self'; img-src 'self' ${FXA_SERVER} ${FXA_USER_CONTENT} www.google-analytics.com ${SITE_CDN} ${CONTENT_CDN} ${CONTENT_NAME} data:; script-src 'self' ${SITE_CDN} www.google-analytics.com 'nonce-${uuid}'; style-src 'self' ${SITE_CDN} 'unsafe-inline' https://code.cdn.mozilla.net; connect-src 'self' ${SITE_CDN} ${CONTENT_CDN} www.google-analytics.com ${dsn}; font-src https://code.cdn.mozilla.net; frame-ancestors 'none'; object-src 'none';`);
}
res.header("X-Frame-Options", "DENY");
next();
Expand Down

0 comments on commit ee63fd4

Please sign in to comment.