소스 검색

[ruby/agoo] Use CGI.escape_html (#10079)

For Rage this seems to be faster.
Petrik de Heus 1 주 전
부모
커밋
985c1a9c81
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      frameworks/Ruby/agoo/app.rb

+ 1 - 1
frameworks/Ruby/agoo/app.rb

@@ -127,7 +127,7 @@ class FortunesHandler < BaseHandler
     f_2 = f_1.map(&:to_h).
             append({ 'id' => '0', 'message' => 'Additional fortune added at request time.' }).
               sort_by { |item| item['message'] }.
-                map { |f| "<tr><td>#{ f['id'] }</td><td>#{ Rack::Utils.escape_html(f['message']) }</td></tr>" }.
+                map { |f| "<tr><td>#{ f['id'] }</td><td>#{ CGI.escape_html(f['message']) }</td></tr>" }.
                   join
 
     html_response(<<-HTML)