Skip to content

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

DEV: Apply suggested changes

Arkshine30ae313decd0
diff --git a/lib/http_user_agent_encoder.rb b/lib/http_user_agent_encoder.rb
index 80ce6d29607..eb57572aace 100644
--- a/lib/http_user_agent_encoder.rb
+++ b/lib/http_user_agent_encoder.rb
@@ -5,8 +5,7 @@ module HttpUserAgentEncoder
return "" unless user_agent
if user_agent.encoding != Encoding::UTF_8
- user_agent = user_agent.encode("utf-8", invalid: :replace, undef: :replace)
- user_agent.scrub!
+ user_agent = user_agent.encode!("utf-8", invalid: :replace, undef: :replace).scrub!
end
user_agent || ""