Forum: Ruby-core [ruby-trunk - Bug #7684][Open] Net::HTTPHeader#set_form_data should accept a String

66f5d5b64b951b3eeb8b6c34fcb69237?d=identicon&s=25 postmodern (Hal Brodigan) (Guest)
on 2013-01-11 05:24
(Received via mailing list)
Issue #7684 has been reported by postmodern (Hal Brodigan).

----------------------------------------
Bug #7684: Net::HTTPHeader#set_form_data should accept a String
https://bugs.ruby-lang.org/issues/7684

Author: postmodern (Hal Brodigan)
Status: Open
Priority: Normal
Assignee:
Category: lib
Target version:
ruby -v: ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-linux]


I noticed that Net::HTTPHeader#set_form_data does not accept already
encoded form-data, but instead passes an Array/Hash down to
URI.encode_www_form.
9077af710bdadc972a7898e457bf6ec1?d=identicon&s=25 Lee Jarvis (hiroshi)
on 2013-01-11 14:04
(Received via mailing list)
Issue #7684 has been updated by injekt (Lee Jarvis).

File set_form_data_string.diff added

You could just set the content body yourself. But I see no reason why
`set_form_data` shouldn't accept a string either
----------------------------------------
Bug #7684: Net::HTTPHeader#set_form_data should accept a String
https://bugs.ruby-lang.org/issues/7684#change-35355

Author: postmodern (Hal Brodigan)
Status: Open
Priority: Normal
Assignee:
Category: lib
Target version:
ruby -v: ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-linux]


I noticed that Net::HTTPHeader#set_form_data does not accept already
encoded form-data, but instead passes an Array/Hash down to
URI.encode_www_form.
C4e88907313843cf07f6d85ba8162120?d=identicon&s=25 ko1 (Koichi Sasada) (Guest)
on 2013-02-17 06:28
(Received via mailing list)
Issue #7684 has been updated by ko1 (Koichi Sasada).

Assignee set to naruse (Yui NARUSE)
Target version set to next minor

Is it a feature request?

----------------------------------------
Bug #7684: Net::HTTPHeader#set_form_data should accept a String
https://bugs.ruby-lang.org/issues/7684#change-36382

Author: postmodern (Hal Brodigan)
Status: Open
Priority: Normal
Assignee: naruse (Yui NARUSE)
Category: lib
Target version: next minor
ruby -v: ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-linux]


I noticed that Net::HTTPHeader#set_form_data does not accept already
encoded form-data, but instead passes an Array/Hash down to
URI.encode_www_form.
58479f76374a3ba3c69b9804163f39f4?d=identicon&s=25 drbrain (Eric Hodel) (Guest)
on 2013-02-17 09:36
(Received via mailing list)
Issue #7684 has been updated by drbrain (Eric Hodel).

Tracker changed from Bug to Feature

If it didn't work this way before I think it is a feature request.
----------------------------------------
Feature #7684: Net::HTTPHeader#set_form_data should accept a String
https://bugs.ruby-lang.org/issues/7684#change-36412

Author: postmodern (Hal Brodigan)
Status: Open
Priority: Normal
Assignee: naruse (Yui NARUSE)
Category: lib
Target version: next minor


I noticed that Net::HTTPHeader#set_form_data does not accept already
encoded form-data, but instead passes an Array/Hash down to
URI.encode_www_form.
9361878d459f1709feec780518946ee5?d=identicon&s=25 naruse (Yui NARUSE) (Guest)
on 2013-02-17 13:21
(Received via mailing list)
Issue #7684 has been updated by naruse (Yui NARUSE).

Status changed from Open to Rejected

Such backdoor breaks the convention that this method returns a valid
application/x-www-form-urlencoded string.

You should set it directly to body.
----------------------------------------
Feature #7684: Net::HTTPHeader#set_form_data should accept a String
https://bugs.ruby-lang.org/issues/7684#change-36433

Author: postmodern (Hal Brodigan)
Status: Rejected
Priority: Normal
Assignee: naruse (Yui NARUSE)
Category: lib
Target version: next minor


I noticed that Net::HTTPHeader#set_form_data does not accept already
encoded form-data, but instead passes an Array/Hash down to
URI.encode_www_form.
This topic is locked and can not be replied to.