Skip to content

Commit eccc73f

Browse files
committed
fixed: json flag + unit tests
1 parent 546e646 commit eccc73f

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ function Framework() {
127127

128128
this.id = null;
129129
this.version = 1700;
130-
this.version_header = '1.7.0 (build: 29)';
130+
this.version_header = '1.7.0 (build: 30)';
131131
this.versionNode = parseInt(process.version.replace('v', '').replace(/\./g, ''), 10);
132132

133133
this.config = {
@@ -7285,7 +7285,7 @@ Subscribe.prototype.doEnd = function() {
72857285
if (route.isJSON) {
72867286
try {
72877287

7288-
if ((req.headers['content-type'] || '').match(/\/json$/)) {
7288+
if (!((req.headers['content-type'] || '').match(/\/json$/))) {
72897289
self.route400(new Error('The request validation (The content-type is not application/json).'));
72907290
return self;
72917291
}

test/controllers/default.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ function plain_put_xml() {
186186
function plain_upload() {
187187
var self = this;
188188
var file = self.files[0];
189-
self.json({ name: file.filename, length: file.length, type: file.contentType });
189+
self.json({ name: file.filename, length: file.length, type: file.type });
190190
}
191191

192192
function file_plain(req, res, isValidation) {

test/views/fromURL.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@{config.name}

0 commit comments

Comments
 (0)