aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Roles/PhotoSet.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/Roles/PhotoSet.pm')
-rw-r--r--perllib/FixMyStreet/Roles/PhotoSet.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/Roles/PhotoSet.pm b/perllib/FixMyStreet/Roles/PhotoSet.pm
index 4a40ef3f9..27a63bad5 100644
--- a/perllib/FixMyStreet/Roles/PhotoSet.pm
+++ b/perllib/FixMyStreet/Roles/PhotoSet.pm
@@ -38,15 +38,18 @@ sub photos {
my $id = $self->id;
my $typ = $self->result_source->name eq 'comment' ? 'c/' : '';
+ my $non_public = $self->result_source->name eq 'comment'
+ ? $self->problem->non_public : $self->non_public;
+
my @photos = map {
my $cachebust = substr($_, 0, 8);
# Some Varnish configurations (e.g. on mySociety infra) strip cookies from
# images, which means image requests will be redirected to the login page
- # if LOGIN_REQUIRED is set. To stop this happening, Varnish should be
+ # if e.g. LOGIN_REQUIRED is set. To stop this happening, Varnish should be
# configured to not strip cookies if the cookie_passthrough param is
# present, which this line ensures will be if LOGIN_REQUIRED is set.
my $extra = '';
- if (FixMyStreet->config('LOGIN_REQUIRED')) {
+ if (FixMyStreet->config('LOGIN_REQUIRED') || $non_public) {
$cachebust .= '&cookie_passthrough=1';
$extra = '?cookie_passthrough=1';
}