Skip to content

A platform for community discussion. Free, open, simple.

Fix modifying frozen strings error in `OneboxController`.

Guo Xiang Tan74989783daaa
diff --git a/app/controllers/onebox_controller.rb b/app/controllers/onebox_controller.rb
index 02fdabe65aa..04116daf069 100644
--- a/app/controllers/onebox_controller.rb
+++ b/app/controllers/onebox_controller.rb
@@ -8,7 +8,7 @@ class OneboxController < ApplicationController
def show
unless params[:refresh] == 'true'
preview = Oneboxer.cached_preview(params[:url])
- preview.strip! if preview.present?
+ preview = preview.strip! if preview.present?
return render(plain: preview) if preview.present?
end
@@ -31,7 +31,7 @@ class OneboxController < ApplicationController
topic_id: topic_id
)
- preview.strip! if preview.present?
+ preview = preview.strip! if preview.present?
Oneboxer.onebox_previewed!(user_id)