Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

[32870] Don't set cache headers for own avatar

Oliver Güntherc3f0ddf743cc
diff --git a/modules/avatars/lib/api/v3/users/user_avatar_api.rb b/modules/avatars/lib/api/v3/users/user_avatar_api.rb
index 0184b7756a5..2e59f328e2e 100644
--- a/modules/avatars/lib/api/v3/users/user_avatar_api.rb
+++ b/modules/avatars/lib/api/v3/users/user_avatar_api.rb
@@ -40,7 +40,7 @@ module API
if (local_avatar = local_avatar?(@user))
respond_with_attachment(local_avatar, cache_seconds: cache_seconds)
elsif avatar_manager.gravatar_enabled?
- set_cache_headers!(cache_seconds)
+ set_cache_headers!(cache_seconds) unless cache_seconds.nil?
redirect build_gravatar_image_url(@user)
else