summaryrefslogtreecommitdiff
path: root/lib/net/http/header.rb
AgeCommit message (Collapse)Author
2025-11-09Reapply "[ruby/net-http] [DOC] Suppress documentation for internals"Nobuyoshi Nakada
This reverts commit af610e107c3a7515228843eb6b1c5978f2ee2685. Reverted by a mistake.
2025-11-09Revert "[ruby/net-http] [DOC] Suppress documentation for internals"Nobuyoshi Nakada
This reverts commit 155cdce539a95b510a80a19e3840cde6b293cd4d.
2025-11-09[ruby/net-http] [DOC] Suppress documentation for internalsNobuyoshi Nakada
https://github.com/ruby/net-http/commit/e4d80bd609
2024-05-30[ruby/net-http] Update lib/net/http/header.rbBrandon Weaver
https://github.com/ruby/net-http/commit/826e008cfe Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
2024-05-30[ruby/net-http] Replace Regexp in for headers for perfBrandon Weaver
https://github.com/ruby/net-http/commit/15f1349e4e
2023-08-16[ruby/net-http] turn on frozen strings for net/http/headerJosh Nichols
https://github.com/ruby/net-http/commit/a5203c9f92
2023-08-16[ruby/net-http] Improve performance of HTTPHeader#content_typeJosh Nichols
In the existing implementation, `main_type` and `sub_type` would end up being called multiple times potentially. Instead of doing that, save the result so it can be re-used. https://github.com/ruby/net-http/commit/179976f7ea
2023-03-31[ruby/net-http] typofixHiroshi SHIBATA
https://github.com/ruby/net-http/commit/4d31bde125
2023-03-31[ruby/net-http] Fix previous commitNAKAMURA Usaku
https://github.com/ruby/net-http/commit/1b276e2654
2023-03-31[ruby/net-http] Limit header lengthNAKAMURA Usaku
https://github.com/ruby/net-http/commit/c245f7f9c8
2023-01-19[ruby/net-http] [DOC] Header docBurdette Lamar
(https://github.com/ruby/net-http/pull/104) https://github.com/ruby/net-http/commit/3308362d9b
2023-01-18[ruby/net-http] [DOC] Enhanced RDoc for set_formBurdette Lamar
(https://github.com/ruby/net-http/pull/103) https://github.com/ruby/net-http/commit/f6506ff889
2023-01-01[ruby/net-http] Enhanced RDoc for HTTPHeaderBurdetteLamar
https://github.com/ruby/net-http/commit/6a282eccdd
2022-12-14[ruby/net-http] [DOC] Correct formatting in header.rbBurdette Lamar
(https://github.com/ruby/net-http/pull/90) https://github.com/ruby/net-http/commit/d9d829ca53
2022-12-12[ruby/net-http] [DOC] Enhanced RDoc for HTTPHeaderBurdette Lamar
(https://github.com/ruby/net-http/pull/88) https://github.com/ruby/net-http/commit/46e966be10
2022-12-01[ruby/net-http] [DOC] Enhanced RDoc for Net::HTTPHeaderBurdette Lamar
(https://github.com/ruby/net-http/pull/83) https://github.com/ruby/net-http/commit/1ea5004098
2022-11-28[ruby/net-http] Enhanced RDoc for header RangeBurdette Lamar
(https://github.com/ruby/net-http/pull/82) https://github.com/ruby/net-http/commit/a26f62a2e5
2022-11-27[ruby/net-http] [DOC] Enhanced RDoc for Net::HTTPHeaderBurdette Lamar
https://github.com/ruby/net-http/commit/77c6878970
2022-11-23[ruby/net-http] Enhanced RDoc for Net::HTTPHeaderBurdetteLamar
https://github.com/ruby/net-http/commit/86b0514239
2022-11-23[ruby/net-http] Enhanced RDoc for Net::HTTPHeaderBurdetteLamar
https://github.com/ruby/net-http/commit/ef0ef53b0c
2022-11-23[ruby/net-http] Enhanced RDoc for Net::HTTPHeaderBurdetteLamar
https://github.com/ruby/net-http/commit/0af9fb94a9
2022-11-23[ruby/net-http] Enhanced RDoc for Net::HTTPHeaderBurdetteLamar
https://github.com/ruby/net-http/commit/995ff356b4
2022-11-23[ruby/net-http] Enhanced RDoc for Net::HTTPHeaderBurdetteLamar
https://github.com/ruby/net-http/commit/e924f1205b
2022-06-16[ruby/net-http] Make `Net::HTTPHeader#content_range` return nil on non-byte ↵Shishir Joshi
units * Returning nil from the `content_range` method instead of raising an error when the unit in the content-range header is not "bytes". Fix https://bugs.ruby-lang.org/issues/11450 https://github.com/ruby/net-http/commit/0b5030dd86 Co-Authored-By: Nobuyoshi Nakada <nobu@ruby-lang.org>
2022-06-16Revert "HTTPHeader.content_range throws error on non-byte units"Nobuyoshi Nakada
This reverts commit 63546bfc1581d4abec2a0d846106a1c0afc0efa9.
2022-06-16HTTPHeader.content_range throws error on non-byte unitsShishir Joshi
* Added a nil check in Net::HTTPHeader#initialize_http_header for keys in the header that do not have any value * Returning nil from the content_range method instead of raising an error when the unit in the content-range header is not bytes * Modified initialize_http_header to match trunk fix [Bug #11450] fix https://github.com/ruby/ruby/pull/1018 Notes: Merged-By: nurse <naruse@airemix.jp>
2020-05-27Improve documentation for Net::HTTPHeader#set_form [ci skip]Jeremy Evans
Fixes [Misc #16916]
2019-08-09Fix typo: duplicated the [skip-ci]ohbarye
2019-07-24Show the caller's locationNobuyoshi Nakada
* lib/net/http/header.rb: show the caller's location instead of the current lines.
2018-12-11ReFix r663197nobu
Stringify after downcase, to restrict arguments. [Bug#15394] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-11Fix r663197nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-10Preserve HTTP header key as string [Bug #15394]naruse
to prevent send Host header twice accidentally. From: Sangyong Sim <sangyong-sim@cookpad.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-19net/http: Improve net/http header error message.marcandre
Patch by Matt Larraz. [Fix GH-1849]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-20raise error if value contains CR/LF in iniheader of initialize_http_headernaruse
like r59693, initialize_http_header also should raise error. [Bug #14208] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12Add uplevel keyword to Kernel#warn and use itshyouhei
If uplevel keyword is given, the warning message is prepended with caller file and line information and the string "warning: ". The use of the uplevel keyword makes Kernel#warn format output similar to how rb_warn formats output. This patch modifies net/ftp and net/imap to use Kernel#warn instead of $stderr.puts or $stderr.printf, since they are used for printing warnings. This makes lib/cgi/core and tempfile use $stderr.puts instead of warn for debug logging, since they are used for debug printing and not for warning. This does not modify bundler, rubygems, or rdoc, as those are maintained outside of ruby and probably wish to remain backwards compatible with older ruby versions. rb_warn_m code is originally from nobu, but I've changed it so that it only includes the path and lineno from uplevel (not the method), and also prepends the string "warning: ", to make it more similar to rb_warn. From: Jeremy Evans code@jeremyevans.net Signed-off-by: Urabe Shyouhei shyouhei@ruby-lang.org git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22Fixed misspelling words.hsbt
These are detected by https://github.com/client9/misspell git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-25HTTPHeader#add_field should allow binary [Bug #13926]naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-30to_str -> to_sko1
* lib/net/http/header.rb (set_field): `val` can not have `to_str`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-30A HTTP Header value must not contain CR or LF.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-08-16* lib/net/http/header.rb: Fix typo. [ci skip][fix GH-1407]hsbt
* transcode.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-04* lib/net/http/header.rb: [DOC] add documentation thatktsj
Net::HTTPHeader#{each_header,each_name,each_capitalized_name, each_value,each_capitalized} without block returns an enumerator. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54907 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-04* lib/net/http/header.rb (Net::HTTPHeader#{each_header,each_name,ktsj
each_capitalized_name,each_value,each_capitalized}): Return sized enumerators. * test/net/http/test_httpheader.rb: add test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54906 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-25net/http/header.rb: refactornobu
* lib/net/http/header.rb (connection_close?): match headers without making intermediate arrays. * lib/net/http/header.rb (connection_keep_alive?): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-29* lib/net/http/header.rb: Warn nil variable on HTTP Header.hsbt
It caused to NoMethodError. [fix GH-952][fix GH-641] Patch by @teosz * test/net/http/test_httpheader.rb: Added test for nil HTTP Header. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-10stdlib: avoid extra calls to eliminate "\n" from Base64normal
We may use the '0' (zero) to avoid adding the line feed. Furthermore, the '*' (asterisk) modifier is not needed for a single-element arrays. * ext/psych/lib/psych/visitors/yaml_tree.rb (visit_String): eliminate chomp * lib/net/http.rb (connect): eliminate delete * lib/net/http/header.rb (basic_encode): ditto * lib/net/imap.rb (authenticate): eliminate gsub (self.encode_utf7): shorten delete arg * lib/net/smtp.rb (base64_encode): eliminate gsub * lib/open-uri.rb (OpenURI.open_http): eliminate delete * lib/rss/rss.rb: ditto * lib/securerandom.rb (base64): ditto (urlsafe_base64): eliminate delete! * lib/webrick/httpauth/digestauth.rb (split_param_value): eliminate chop * lib/webrick/httpproxy.rb (do_CONNECT): eliminate delete (setup_upstream_proxy_authentication): ditto [ruby-core:72666] [Feature #11938] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-23[DOC] Fix typosa_matsuda
* benchmark.rb * getoptlong.rb * irb.rb * net/http.rb * net/http/header.rb * net/imap.rb * optparse.rb * pstore.rb * webrick.rb * xmlrpc.rb [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16Add frozen_string_literal: false for all filesnaruse
When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-08* lib/net/http/header.rb: pass header names as symbols.hsbt
Patch by @DamirSvrtan [fix GH-805] * test/net/http/test_httpheader.rb: added test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-07 * lib/net/http/header.rb: [DOC] Net::HTTP#to_hash returns pair of key ↵hsbt
and array values. Thanks @bjhaid [fix GH-467] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-08range.c: revert r42400nobu
* range.c (range_last): revert r42400. [Bug #8739] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e