Skip to content

Conversation

leriksen
Copy link

bug_10591 - update regex to require one or more spaces (changed from zero or more) between the status code and the reason code.

RFC2616 says
Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF

http://grokbase.com/t/apache/dev/085mz81ecq/empty-reason-phrase-bz-44995-45092
Reason-Phrase = *<TEXT, excluding CR, LF>
This seems to imply that the Reason-Phrase can be empty.

Updated test cases to catch any regressions if the regex is changed at this point again.

…zero or more) between the status code and the reason code.

RFC2616 says
Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF

Reason-Phrase does not appear to be optional, hence I haven't wrapped as a non-capturing option.

Updated test case to catch any regressions if the regex is changed at this point again.
…o I support that, with and without a trailing space as also implied by the RFC

Reason-Phrase = *<TEXT, excluding CR, LF>

Because of the star (*) I read this as "empty reason phrase is allowed".
(http://grokbase.com/t/apache/dev/085mz81ecq/empty-reason-phrase-bz-44995-45092)
@nurse nurse closed this in 0f7e301 Dec 23, 2014
nurse added a commit that referenced this pull request Dec 23, 2014
	* lib/net/http/response.rb (Net::HTTPResponse): require one or more
	  spaces [Bug #10591].
	  by leriksen <leif.eriksen.au@gmail.com>
	  #782 fix GH-782
	  NOTE: graph.facebook.com returns without SP Reason-Phrase.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@48952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
ayumin pushed a commit to ayumin/ruby that referenced this pull request Jan 4, 2015
  spaces [Bug ruby#10591].
  by leriksen <leif.eriksen.au@gmail.com>
  ruby#782 fix rubyGH-782
  NOTE: graph.facebook.com returns without SP Reason-Phrase.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
evanphx pushed a commit that referenced this pull request Jan 14, 2015
	* lib/net/http/response.rb (Net::HTTPResponse): require one or more
	  spaces [Bug #10591].
	  by leriksen <leif.eriksen.au@gmail.com>
	  #782 fix GH-782
	  NOTE: graph.facebook.com returns without SP Reason-Phrase.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@49250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
evanphx pushed a commit that referenced this pull request Feb 19, 2015
	* lib/net/http/response.rb (Net::HTTPResponse): require one or more
	  spaces [Bug #10591].
	  by leriksen <leif.eriksen.au@gmail.com>
	  #782 fix GH-782
	  NOTE: graph.facebook.com returns without SP Reason-Phrase.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@49652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
hsbt pushed a commit that referenced this pull request Mar 10, 2015
	* lib/net/http/response.rb (Net::HTTPResponse): require one or more
	  spaces [Bug #10591].
	  by leriksen <leif.eriksen.au@gmail.com>
	  #782 fix GH-782
	  NOTE: graph.facebook.com returns without SP Reason-Phrase.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@49652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
hsbt pushed a commit that referenced this pull request Mar 10, 2015
	* lib/net/http/response.rb (Net::HTTPResponse): require one or more
	  spaces [Bug #10591].
	  by leriksen <leif.eriksen.au@gmail.com>
	  #782 fix GH-782
	  NOTE: graph.facebook.com returns without SP Reason-Phrase.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@49250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
mmasaki pushed a commit to mmasaki/ruby that referenced this pull request May 30, 2015
  spaces [Bug ruby#10591].
  by leriksen <leif.eriksen.au@gmail.com>
  ruby#782 fix rubyGH-782
  NOTE: graph.facebook.com returns without SP Reason-Phrase.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
hsbt pushed a commit to ruby/net-http that referenced this pull request Feb 13, 2020
  spaces [Bug #10591].
  by leriksen <leif.eriksen.au@gmail.com>
  ruby/ruby#782 fix GH-782
  NOTE: graph.facebook.com returns without SP Reason-Phrase.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant