Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not set Content-Type for DELETE requests #132

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/rack/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def env_for(path, env)
# Stringifying and upcasing methods has be commit upstream
env["REQUEST_METHOD"] ||= env[:method] ? env[:method].to_s.upcase : "GET"

if env["REQUEST_METHOD"] == "GET"
if ["GET", "DELETE"].include?(env["REQUEST_METHOD"])
# merge :params with the query string
if params = env[:params]
params = parse_nested_query(params) if params.is_a?(String)
Expand Down
6 changes: 6 additions & 0 deletions spec/rack/test_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,12 @@ def verb
describe "#delete" do
it_should_behave_like "any #verb methods"

it "does not set a content type" do
delete "/"

last_request.env['CONTENT_TYPE'].should be_nil
end

def verb
"delete"
end
Expand Down