Skip to content

Commit

Permalink
Don't send a body for delete requests
Browse files Browse the repository at this point in the history
  • Loading branch information
andyjeffries committed Aug 31, 2017
1 parent 7f902ab commit c5ae379
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 1.4.5

Bugfix:

- DELETE requests shouldn't send a request body, the body semantics are undefined.

## 1.4.4

Feature:
Expand Down
2 changes: 1 addition & 1 deletion lib/flexirest/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ def prepare_request_body(params = nil)

headers["Accept"] ||= "application/vnd.api+json"
JsonAPIProxy::Headers.save(headers)
elsif http_method == :get
elsif http_method == :get || http_method == :delete
@body = ""
elsif request_body_type == :form_encoded
@body ||= (params || @post_params || {}).to_query
Expand Down
2 changes: 1 addition & 1 deletion lib/flexirest/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Flexirest
VERSION = "1.4.4"
VERSION = "1.4.5"
end

0 comments on commit c5ae379

Please sign in to comment.