I would like to make another suggestion on this issue. #1787
The implementation of Go is a problem. But in reality there are such HTTP clients.
I think rack should ignore them.
sinatra has implemented the following response to this problem.
https://github.com/sinatra/sinatra/pull/1743/files
I think this sinatra change is terrible. However, due to the implementation of rack, sinatra has no choice but to do this.
I propose the following changes to this issue.
|
def form_data? |
|
type = media_type |
|
meth = get_header(RACK_METHODOVERRIDE_ORIGINAL_METHOD) || get_header(REQUEST_METHOD) |
|
|
|
(meth == POST && type.nil?) || FORM_DATA_MEDIA_TYPES.include?(type) |
|
end |
We will change the implementation of this function so that form_data? is false for GET methods. For example:
- (meth == POST && type.nil?) || FORM_DATA_MEDIA_TYPES.include?(type)
+ (meth == POST && type.nil?) || (meth != GET && FORM_DATA_MEDIA_TYPES.include?(type))
We rarely send form data with the GET method.
However, this implementation would cause multiple rack tests to fail. This should be corrected in the test itself.
I would like to make another suggestion on this issue. #1787
The implementation of Go is a problem. But in reality there are such HTTP clients.
I think rack should ignore them.
sinatra has implemented the following response to this problem.
https://github.com/sinatra/sinatra/pull/1743/files
I think this sinatra change is terrible. However, due to the implementation of rack, sinatra has no choice but to do this.
I propose the following changes to this issue.
rack/lib/rack/request.rb
Lines 470 to 475 in a7d5649
We will change the implementation of this function so that form_data? is false for GET methods. For example:
We rarely send form data with the GET method.
However, this implementation would cause multiple rack tests to fail. This should be corrected in the test itself.