From 49527f9ed291b494451f9f133ba6597222ef8488 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Tue, 23 Jun 2026 14:24:31 +0900 Subject: [PATCH 1/2] [DOC] Fix accept_charset default value in examples CGI.accept_charset is initialized to Encoding::UTF_8 by the cgi/escape extension when 'cgi' is required, so the inspect examples should show #, not the string "UTF-8". Co-Authored-By: Claude Opus 4.8 --- lib/cgi/core.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/cgi/core.rb b/lib/cgi/core.rb index d045adb..128c368 100644 --- a/lib/cgi/core.rb +++ b/lib/cgi/core.rb @@ -953,16 +953,16 @@ def self.accept_charset # see {Encodings}[https://docs.ruby-lang.org/en/master/language/encodings_rdoc.html]: # # # The initial value. - # CGI.accept_charset # => "UTF-8" + # CGI.accept_charset # => # # CGI.new # # => # #, # @accept_charset_error_block=nil, # @cookies={}, # @max_multipart_length=134217728, # @multipart=false, - # @options={accept_charset: "UTF-8", max_multipart_length: 134217728}, + # @options={accept_charset: #, max_multipart_length: 134217728}, # @output_cookies=nil, # @output_hidden=nil, # @params={}> @@ -1045,12 +1045,12 @@ def self.accept_charset=(accept_charset) # cgi # # => # #, # @accept_charset_error_block=nil, # @cookies={}, # @max_multipart_length=134217728, # @multipart=false, - # @options={accept_charset: "UTF-8", max_multipart_length: 134217728}, + # @options={accept_charset: #, max_multipart_length: 134217728}, # @output_cookies=nil, # @output_hidden=nil, # @params={}> From 4122fc4de5e8d8d9d0708b5c2bcb20e157074bd4 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Tue, 23 Jun 2026 14:25:03 +0900 Subject: [PATCH 2/2] [DOC] Fix wording in CGI#http_header The +content_type+ paragraph said "its default value" while its example shows the given value being used, and the 'length' key was missing "to". Co-Authored-By: Claude Opus 4.8 --- lib/cgi/core.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/cgi/core.rb b/lib/cgi/core.rb index 128c368..b5c3a1e 100644 --- a/lib/cgi/core.rb +++ b/lib/cgi/core.rb @@ -134,7 +134,7 @@ def stdoutput # Content-Type: text/html # # With string argument +content_type+ given, - # includes header +Content-Type+ with its default value 'text/html': + # includes header +Content-Type+ with the given value: # # puts cgi.http_header('text/xml') # Content-Type: text/xml @@ -214,7 +214,7 @@ def stdoutput # Content-Language: en-US, en-CA # # 'length':: - # Sets header +Content-Length+ the given value, + # Sets header +Content-Length+ to the given value, # which may be an integer or a string: # # puts cgi.http_header('length' => 4096) @@ -228,7 +228,7 @@ def stdoutput # 'nph':: # If +true+: # - # - Adds protocol string and status code as first line, + # - Adds protocol string and status code as first line. # - Adds date as second line. # - Adds headers +Server+ with no value, # and +Connection+ with default value 'close';