PERF: omit HTML view from sessions by logged on users. (#26170)

You need JS to log on to Discourse anyway, HTML only serves for debugging
purpose, no need to send it
This commit is contained in:
Sam
2024-03-14 15:48:29 +11:00
committed by GitHub
parent 1f786f4972
commit e05628c079
2 changed files with 9 additions and 1 deletions
+8
View File
@@ -10,6 +10,14 @@ RSpec.describe ApplicationHelper do
HTML
end
it "does not send crawler content to logged on users" do
controller.stubs(:use_crawler_layout?).returns(false)
helper.stubs(:current_user).returns(Fabricate(:user))
helper.request.user_agent = "Firefox"
expect(helper.include_crawler_content?).to eq(false)
end
it "sends crawler content to old mobiles" do
controller.stubs(:use_crawler_layout?).returns(false)