Skip to content

Commit

Permalink
fix: fix content type parse
Browse files Browse the repository at this point in the history
  • Loading branch information
John Conley committed Dec 21, 2018
1 parent 6fcf064 commit 06b06bd
Show file tree
Hide file tree
Showing 3 changed files with 296 additions and 189 deletions.
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
"license": "MIT",
"devDependencies": {
"@commitlint/config-conventional": "^7.1.2",
"@types/node": "10.5.7",
"commitlint": "^7.1.2",
"@types/node": "10.12.18",
"commitlint": "^7.2.1",
"cz-conventional-changelog": "^2.1.0",
"husky": "^1.0.1",
"semantic-release": "^15.9.16",
"tslint": "^5.11.0",
"typescript": "^3.0.3",
"valory-runtime": "^3.8.1"
"husky": "^1.3.0",
"semantic-release": "^15.13.1",
"tslint": "^5.12.0",
"typescript": "^3.2.2",
"valory-runtime": "^3.12.2"
},
"files": [
"dist/adaptor-polka.js",
Expand Down
3 changes: 2 additions & 1 deletion src/adaptor-polka.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ function attemptParse(contentType: string, obj: any): any {
if (contentType == null) {
return obj;
}
const parsedContentType = contentType.split(";")[0];
try {
switch (contentType) {
switch (parsedContentType) {
case "application/json":
return JSON.parse(obj);
case "application/x-www-form-urlencoded":
Expand Down
Loading

0 comments on commit 06b06bd

Please sign in to comment.