Merge pull request #7113 from opf/fix/29673/activity-304-nonce

[29673] Avoid stale? with CSP nonces on activities controller

[ci skip]
pull/7122/head
Oliver Günther 6 years ago committed by GitHub
commit 539db520e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 36
      app/controllers/activities_controller.rb

@ -52,30 +52,20 @@ class ActivitiesController < ApplicationController
events = @activity.events(@date_from, @date_to)
censor_events_from_projects_with_disabled_activity!(events) unless @project
if events.empty? || stale?(etag: [@activity.scope,
@date_to,
@date_from,
@with_subprojects,
@author,
events.first,
User.current,
current_language,
DesignColor.overwritten])
respond_to do |format|
format.html do
@events_by_day = events.group_by { |e| e.event_datetime.in_time_zone(User.current.time_zone).to_date }
render layout: false if request.xhr?
end
format.atom do
title = l(:label_activity)
if @author
title = @author.name
elsif @activity.scope.size == 1
title = l("label_#{@activity.scope.first.singularize}_plural")
end
render_feed(events, title: "#{@project || Setting.app_title}: #{title}")
respond_to do |format|
format.html do
@events_by_day = events.group_by { |e| e.event_datetime.in_time_zone(User.current.time_zone).to_date }
render layout: false if request.xhr?
end
format.atom do
title = l(:label_activity)
if @author
title = @author.name
elsif @activity.scope.size == 1
title = l("label_#{@activity.scope.first.singularize}_plural")
end
render_feed(events, title: "#{@project || Setting.app_title}: #{title}")
end
end

Loading…
Cancel
Save