Skip to content

Commit e48f677

Browse files
committed
Merge pull request #140 from Ognian/fix-charset-in-content-type
Fix charset in content type
2 parents d78be6e + bf4d3e0 commit e48f677

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

jsonary/request.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ Request.prototype = {
396396
var remainder = headers["content-type"].substring(contentType.length + 1);
397397
while (remainder.length > 0) {
398398
remainder = remainder.replace(/^,\s*/, '');
399+
remainder = remainder.replace(/^;\s*/, '');
399400
var partName = remainder.split("=", 1)[0];
400401
remainder = remainder.substring(partName.length + 1).trim();
401402
partName = partName.trim();
@@ -412,7 +413,7 @@ Request.prototype = {
412413
contentTypeParameters[partName] = partValue;
413414
}
414415
} else {
415-
partValue = /^[^,]*/.exec(remainder)[0];
416+
partValue = /^[^,;]*/.exec(remainder)[0];
416417
remainder = remainder.substring(partValue.length).trim();
417418
contentTypeParameters[partName] = partValue;
418419
}

renderers/contributed/adaptive-table.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Jsonary.render.register(Jsonary.plugins.Generator({
2727
if (!columnsObj[column]) {
2828
columnsObj[column] = true;
2929
renderer.addColumn(column, schemas.title() || column, function (data, context) {
30-
if (data.basicType() == "object" && depthRemaining <= 0) {
30+
if (data.basicType() == "object" && depthRemaining < 0) {
3131
return '<td class="jsonary-recursion-limit-reached">...</td>';
3232
} else {
3333
return this.defaultCellRenderHtml(data, context, column);

0 commit comments

Comments
 (0)