5 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,8 @@ static VALUE
36
36
optimized_escape_html (VALUE str )
37
37
{
38
38
VALUE vbuf ;
39
- char * buf = ALLOCV_N (char , vbuf , RSTRING_LEN (str ) * HTML_ESCAPE_MAX_LEN );
39
+ typedef char escape_buf [HTML_ESCAPE_MAX_LEN ];
40
+ char * buf = * ALLOCV_N (escape_buf , vbuf , RSTRING_LEN (str ));
40
41
const char * cstr = RSTRING_PTR (str );
41
42
const char * end = cstr + RSTRING_LEN (str );
42
43
Original file line number Diff line number Diff line change @@ -159,7 +159,6 @@ def self.parse(raw_cookie)
159
159
raw_cookie . split ( /;\s ?/ ) . each do |pairs |
160
160
name , values = pairs . split ( '=' , 2 )
161
161
next unless name and values
162
- name = CGI . unescape ( name )
163
162
values ||= ""
164
163
values = values . split ( '&' ) . collect { |v | CGI . unescape ( v , @@accept_charset ) }
165
164
if cookies . has_key? ( name )
Original file line number Diff line number Diff line change 1
1
class CGI
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.0.1 "
3
3
end
Original file line number Diff line number Diff line change @@ -101,6 +101,11 @@ def test_cgi_cookie_parse
101
101
end
102
102
end
103
103
104
+ def test_cgi_cookie_parse_not_decode_name
105
+ cookie_str = "%66oo=baz;foo=bar"
106
+ cookies = CGI ::Cookie . parse ( cookie_str )
107
+ assert_equal ( { "%66oo" => [ "baz" ] , "foo" => [ "bar" ] } , cookies )
108
+ end
104
109
105
110
def test_cgi_cookie_arrayinterface
106
111
cookie = CGI ::Cookie . new ( 'name1' , 'a' , 'b' , 'c' )
Original file line number Diff line number Diff line change 2
2
# define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR
3
3
#define RUBY_VERSION_TEENY 5
4
4
#define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
5
- #define RUBY_PATCHLEVEL 202
5
+ #define RUBY_PATCHLEVEL 203
6
6
7
7
#define RUBY_RELEASE_YEAR 2021
8
8
#define RUBY_RELEASE_MONTH 11
0 commit comments