summaryrefslogtreecommitdiff
path: root/test/cgi
Commit message (Collapse)AuthorAgeFilesLines
* [ruby/cgi] Loosen the domain regex to accept '.'Xenor Chang2022-11-281-0/+3
| | | | | | | | | | | (https://github.com/ruby/cgi/pull/29) * Loosen the domain regex to accept '.' Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> https://github.com/ruby/cgi/commit/5e09d632f3 Co-authored-by: Hiroshi SHIBATA <hsbt@ruby-lang.org>
* [ruby/cgi] Fix test_cgi_cookie_new_with_domain to pass on older rubiesJean Boussier2022-11-241-4/+4
| | | | https://github.com/ruby/cgi/commit/05f0c58048
* [ruby/cgi] Relax domain label restrictionsNobuyoshi Nakada2022-11-221-0/+18
| | | | https://github.com/ruby/cgi/commit/b46d41c363
* [ruby/cgi] Prevent CRLF injectionYusuke Endoh2022-11-221-0/+8
| | | | | | | | | Throw a RuntimeError if the HTTP response header contains CR or LF to prevent HTTP response splitting. https://hackerone.com/reports/1204695 https://github.com/ruby/cgi/commit/64c5045c0a
* [ruby/cgi] Check cookie name/path/domain charactersNobuyoshi Nakada2022-11-221-0/+64
| | | | | | https://hackerone.com/reports/1204977 https://github.com/ruby/cgi/commit/30107a4797
* [ruby/cgi] Implement `CGI.url_encode` and `CGI.url_decode`Jean Boussier2022-08-161-1/+48
| | | | | | | | [Feature #18822] Ruby is somewhat missing an RFC 3986 compliant escape method. https://github.com/ruby/cgi/commit/c2729c7f33
* [ruby/cgi] jruby supportPavel Rosický2022-06-061-0/+1
| | | | https://github.com/ruby/cgi/commit/93326fb622
* [ruby/cgi] Check integer overflow in long rangeNobuyoshi Nakada2021-12-121-0/+17
| | | | | | https://hackerone.com/reports/1328463 https://github.com/ruby/cgi/commit/ccaf6027e0
* [ruby/cgi] When parsing cookies, only decode the valuesNobuyoshi Nakada2021-11-241-0/+5
| | | | https://github.com/ruby/cgi/commit/052eb3a828
* [ruby/cgi] Add test for escapeHTML/unescapeHTML invalid encoding fix in pure ↵Jeremy Evans2021-04-221-3/+30
| | | | | | | | | ruby version Also, remove pointless assert_nothing_raised(ArgumentError) while here. https://github.com/ruby/cgi/commit/c05edf5608
* need to restore $stdin.Koichi Sasada2020-03-021-0/+4
|
* Deprecate taint/trust and related methods, and make the methods no-opsJeremy Evans2019-11-181-7/+0
| | | | | | This removes the related tests, and puts the related specs behind version guards. This affects all code in lib, including some libraries that may want to support older versions of Ruby.
* change call CGI methods from :: to .Semyon Pupkov2019-08-041-31/+31
| | | | Closes: https://github.com/ruby/ruby/pull/1749
* Get rid of error with frozen string literalMSP-Greg (Greg L)2019-06-231-2/+1
| | | | [Bug #14194]
* Revert "ext/cgi/escape: preserve String subclass in result"normal2018-05-031-21/+0
| | | | | | | This reverts commit 6afea14043b0c0e603f26c89ae0d043f65852668 r63328 I misread the original bug report and got results flipped. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/cgi/escape: preserve String subclass in resultnormal2018-05-021-0/+21
| | | | | | | | | | | * ext/cgi/escape/escape.c (optimized_escape_html): use rb_str_new_with_class (optimized_unescape_html): ditto (optimized_escape): ditto (optimized_unescape): ditto * test/cgi/test_cgi_util.rb (test_escape_string_subclass): new test [ruby-core:86847] [Bug #14732] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix strange indentationk0kubun2017-05-181-2/+2
| | | | | | | which I introduced at r58773. Hard tabs and spaces are mixed... git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* cgi/util.rb: Don't escape tilde in #escapek0kubun2017-05-171-0/+6
| | | | | | | | to make it compatible with ERB::Util.url_encode. ext/cgi/escape/escape.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* share `@@accept_charset`nobu2017-05-061-0/+4
| | | | | | | | * lib/cgi/{core,util}.rb: include CGI::Util not only extending, to share `@@accept_charset` class variable, so that it is always accessible. [ruby-core:80986] [Bug #13539] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* {lib,test}/cgi: Specify frozen_string_literal: true.kazu2017-02-188-42/+42
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* escape.c: check argumentnobu2017-02-021-0/+6
| | | | | | | * ext/cgi/escape/escape.c (optimized_unescape): check accept_charset encoding argument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_cgi_util.rb: encoding testsnobu2017-02-021-4/+10
| | | | | | | | | * test/cgi/test_cgi_util.rb (test_cgi_unescape): \u is useless on old versions. * test/cgi/test_cgi_util.rb (test_cgi_include_unescape): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/cgi/cookie.rb (parse): don't allow , as a separator. [Bug #12791]naruse2016-09-271-2/+5
| | | | | | * lib/webrick/cookie.rb (parse): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test: use assert_includenobu2016-07-261-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* cgi/util.rb: remove CGI::Util#_unescapenobu2016-04-201-0/+17
| | | | | | | | | | * ext/cgi/escape/escape.c (cgiesc_unescape): define unescape method instead of _unescape, and should pass the optional argument to the super method. * lib/cgi/util.rb (CGI::Util#_unescape): remove intermediate method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_cgi_util.rb: test_cgi_unescapeHTML_invalidnobu2016-02-141-0/+4
| | | | | | | * test/cgi/test_cgi_util.rb (test_cgi_unescapeHTML_invalid): test for invalid escaped HTML, borrowed from rubyspec. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ASCII-incompatible escapenobu2016-02-061-0/+16
| | | | | | | * lib/cgi/util.rb (escapeHTML, unescapeHTML): consider ASCII-incompatible encodings. [Fix GH-1239] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* escape.c: should not freezenobu2015-12-221-8/+24
| | | | | | | | * ext/cgi/escape/escape.c (optimized_escape_html): CGI.escapeHTML should return unfrozen new string. [ruby-core:72426] [Bug #11858] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* escape.c: Preserve original statenobu2015-12-211-0/+10
| | | | | | | | * ext/cgi/escape/escape.c (preserve_original_state): Preserve original state for tainted and frozen. [Fix GH-1166] [ruby-dev:49451] [Bug #11855] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* cgi/escape: Optimize CGI.escapeHTMLnobu2015-12-201-0/+6
| | | | | | | * cgi/escape/escape.c: Optimize CGI.escapeHTML for ASCII-compatible encodings. [Fix GH-1164] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_cgi_util.rb: fix arguments ordersnobu2015-12-201-6/+6
| | | | | | | * test/cgi/test_cgi_util.rb: fix arguments orders, expected values should be placed first and then actual results. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add frozen_string_literal: false for all filesnaruse2015-12-169-0/+9
| | | | | | 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
* test: use String#b instead of dup.force_encodingnobu2015-12-141-2/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/cgi/cookie.rb: Implement HttpOnly flag for cookies.xibbar2015-05-141-1/+4
| | | | | | [fix GH-887] Patch by @martinpovolny git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50496 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* cookie.rb: trailing commanobu2015-04-291-1/+1
| | | | | | * lib/cgi/cookie.rb: add trailing comma for further lines. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix env leaksnobu2015-03-129-92/+105
| | | | | | | | | | | | | | | | * lib/rubygems/test_case.rb (setup, teardown): fix environment variable change leaks. * test/cgi/update_env.rb: ditto. * test/rake/test_rake_application_options.rb (setup, teardown): ditto. * test/rake/test_rake_file_utils.rb (setup, teardown): ditto. * test/rubygems/test_gem_request.rb (setup): add https_proxy. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/lib/envutil.rb: Moved from test/ruby/.akr2014-11-131-1/+0
| | | | | | | | | | | | | | * test/lib/find_executable.rb: Ditto. * test/lib/memory_status.rb: Ditto. * test/lib/test/unit.rb: require envutil. * test/: Don't require envutil in test files. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/cgi/test_cgi_core.rb: removed obsoleted condition for Ruby 1.8.hsbt2014-08-094-92/+21
| | | | | | | | * test/cgi/test_cgi_header.rb: ditto. * test/cgi/test_cgi_multipart.rb: ditto. * test/cgi/test_cgi_tag_helper.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/cgi/core.rb: Provide a mechanism to specify thexibbar2014-06-101-6/+21
| | | | | | | max_multipart_length of multipart data. [Feature #8370] patch by Leif Eriksen <leif.eriksen.au@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use Tempfile#close!.akr2014-05-271-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/cgi/core.rb: Use Tempfile#close(true) instead of Tempfile#unlinkakr2014-05-271-3/+3
| | | | | | | | to close file descriptors. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* cgi/util.rb: use aliasnobu2014-03-211-0/+15
| | | | | | | | | * lib/cgi/util.rb (escape_html, unescape_html): make synonyms aliases instead of wrapper methods. * lib/cgi/util.rb (escape_element, unescape_element): ditto. [Fixes GH-573] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_cgi_util.rb: escape for ruby-mode.elnobu2014-03-211-4/+4
| | | | | | | * test/cgi/test_cgi_util.rb (CGIUtilTest): escape '<' not ruby-mode.el to confuse with here documents. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/cgi/util.rb: class methods modulize for using like a function.xibbar2013-05-031-1/+22
| | | | | | [Feature #8354] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/cgi/html.rb: fix tagmaker because attributes should recognize.xibbar2013-04-111-0/+1
| | | | | | [Bug #8252] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/cgi/util.rb (CGI::unescapeHTML): fix Hexadecimal numeric character.xibbar2013-04-081-0/+4
| | | | | | [Bug #8183] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/cgi/test_cgi_core.rb: Add test for CGI#header.xibbar2012-11-081-1/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/cgi/core.rb: check if Tempfile is defined before use it.naruse2012-11-051-0/+29
| | | | | | * lib/cgi/core.rb: remove tempfiles only if tempfiles exist git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Mon Nov 5 09:55:05 2012 Takeyuki FUJIOKA <xibbar@ruby-lang.org>xibbar2012-11-051-0/+16
| | | | | | * lib/cgi/core.rb: remove tempfile more early. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37471 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Sun Nov 4 20:41:28 2012 Takeyuki FUJIOKA <xibbar@ruby-lang.org>xibbar2012-11-044-30/+39
| | | | | | | | | * lib/cgi.rb, lib/cgi/*/rb: rename CGI#header to CGI#http_header, add and update HTML5 tag generater. [Bug #7110] Patch provided by Marcus Stollsteimer, thank you ! git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e