Project

General

Profile

Bug #14184

Backport r61197 (webrick: compile RE correctly for beginning and end match)

Added by nagachika (Tomoyuki Chikanaga) almost 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
-
[ruby-dev:50347]

Description

バックポート管理用チケットです。

Associated revisions

Revision 61197
Added by normalperson (Eric Wong) almost 2 years ago

webrick: compile RE correctly for beginning and end match

Using ^ and $ in regexps means we can accidentally get fooled
by "%0a" in HTTP request paths being decoded to newline
characters. Use \A and \z to match beginning and end-of-string
respectively, instead.

Thanks to mame and hsbt for reporting.

  • lib/webrick/httpserver.rb (MountTable#compile): use \A and \z instead of ^ and $
  • lib/webrick/httpserver.rb (MountTable#normalize): use \z instead of $
  • test/webrick/test_httpserver.rb (test_cntrl_in_path): new test

Revision 096db35a
Added by nagachika (Tomoyuki Chikanaga) almost 2 years ago

merge revision(s) 61197: [Backport #14184]

    webrick: compile RE correctly for beginning and end match

    Using ^ and $ in regexps means we can accidentally get fooled
    by "%0a" in HTTP request paths being decoded to newline
    characters.  Use \A and \z to match beginning and end-of-string
    respectively, instead.

    Thanks to mame and hsbt for reporting.

    * lib/webrick/httpserver.rb (MountTable#compile):
      use \A and \z instead of ^ and $
    * lib/webrick/httpserver.rb (MountTable#normalize): use \z instead of $
    * test/webrick/test_httpserver.rb (test_cntrl_in_path): new test

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@61238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 61238
Added by nagachika (Tomoyuki Chikanaga) almost 2 years ago

merge revision(s) 61197: [Backport #14184]

webrick: compile RE correctly for beginning and end match

Using ^ and $ in regexps means we can accidentally get fooled
by "%0a" in HTTP request paths being decoded to newline
characters.  Use \A and \z to match beginning and end-of-string
respectively, instead.

Thanks to mame and hsbt for reporting.

* lib/webrick/httpserver.rb (MountTable#compile):
  use \A and \z instead of ^ and $
* lib/webrick/httpserver.rb (MountTable#normalize): use \z instead of $
* test/webrick/test_httpserver.rb (test_cntrl_in_path): new test

Revision ccbe964c
Added by usa (Usaku NAKAMURA) almost 2 years ago

merge revision(s) 61197: [Backport #14184]

    webrick: compile RE correctly for beginning and end match

    Using ^ and $ in regexps means we can accidentally get fooled
    by "%0a" in HTTP request paths being decoded to newline
    characters.  Use \A and \z to match beginning and end-of-string
    respectively, instead.

    Thanks to mame and hsbt for reporting.

    * lib/webrick/httpserver.rb (MountTable#compile):
      use \A and \z instead of ^ and $
    * lib/webrick/httpserver.rb (MountTable#normalize): use \z instead of $
    * test/webrick/test_httpserver.rb (test_cntrl_in_path): new test

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@61241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 61241
Added by usa (Usaku NAKAMURA) almost 2 years ago

merge revision(s) 61197: [Backport #14184]

webrick: compile RE correctly for beginning and end match

Using ^ and $ in regexps means we can accidentally get fooled
by "%0a" in HTTP request paths being decoded to newline
characters.  Use \A and \z to match beginning and end-of-string
respectively, instead.

Thanks to mame and hsbt for reporting.

* lib/webrick/httpserver.rb (MountTable#compile):
  use \A and \z instead of ^ and $
* lib/webrick/httpserver.rb (MountTable#normalize): use \z instead of $
* test/webrick/test_httpserver.rb (test_cntrl_in_path): new test

History

Updated by nagachika (Tomoyuki Chikanaga) almost 2 years ago

  • Backport changed from 2.3: REQUIRED, 2.4: REQUIRED to 2.3: REQUIRED, 2.4: DONE

ruby_2_4 r61238 merged revision(s) 61197.

Updated by usa (Usaku NAKAMURA) almost 2 years ago

  • Backport changed from 2.3: REQUIRED, 2.4: DONE to 2.3: DONE, 2.4: DONE

ruby_2_3 r61241 merged revision(s) 61197.

Also available in: Atom PDF