Skip to content
This repository has been archived by the owner on Mar 15, 2023. It is now read-only.

Commit

Permalink
Fixed check for using urlencoded content type for non-get requests wi…
Browse files Browse the repository at this point in the history
…th only params
  • Loading branch information
j.van.mourik committed May 2, 2016
1 parent 2c9a7f7 commit a6451db
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.2.3

- [BUGFIX] Fixed check for using urlencoded content type for non-get requests with only query parameters

## 0.2.2

- [BUGFIX] Use urlencoded content type for non-get requests with only query parameters
Expand Down
2 changes: 1 addition & 1 deletion addon/services/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export default AjaxService.extend({
options.contentType = JSONContentType;
options.processData = false;
}
if (options.params && options.data && !Object.keys(options.data).length) {
if (options.params && (!options.data || typeof options.data === 'object' && !Object.keys(options.data).length)) {
options.contentType = URLEncodedContentType;
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ember-api-requests",
"version": "0.2.2",
"version": "0.2.3",
"description": "Service for making custom requests to a backend API.",
"directories": {
"doc": "doc",
Expand Down

0 comments on commit a6451db

Please sign in to comment.