Skip to content

Commit

Permalink
Remove stable/local URL, remove trailing slash, revise CSP allow-list…
Browse files Browse the repository at this point in the history
… URLs
  • Loading branch information
maxxcrawford committed May 26, 2021
1 parent 7aa3a69 commit 7305c6a
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions privaterelay/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,13 @@
)
# maps fxa profile hosts to respective avatar hosts for CSP
AVATAR_IMG_SRC_MAP = {
'https://stable.dev.lcip.org/profile/v1': [
'stable.dev.lcip.org',
'https://stable.dev.lcip.org/profile/v1/avatar/w',
],
'https://profile.stage.mozaws.net/v1': [
'mozillausercontent.com',
'https://profile.stage.mozaws.net/v1/avatar/w',
'https://profile.stage.mozaws.net',
],
'https://profile.accounts.firefox.com/v1': [
'firefoxusercontent.com',
'https://profile.accounts.firefox.com/v1/avatar/w',
'https://profile.accounts.firefox.com',
],
}
AVATAR_IMG_SRC = AVATAR_IMG_SRC_MAP[config(
Expand All @@ -83,7 +79,7 @@
)
CSP_STYLE_SRC = ("'self'",)
CSP_IMG_SRC = ["'self'"] + AVATAR_IMG_SRC
REFERRER_POLICY = 'strict-origin-when-cross-origin' \
REFERRER_POLICY = 'strict-origin-when-cross-origin'

ALLOWED_HOSTS = []
DJANGO_ALLOWED_HOST = config('DJANGO_ALLOWED_HOST', None)
Expand Down

0 comments on commit 7305c6a

Please sign in to comment.