@orion-js/http
Advanced tools
Comparing version 3.0.37 to 3.0.40
@@ -24,3 +24,3 @@ "use strict"; | ||
// add body to response | ||
if (result.body) { | ||
if (!(0, lodash_1.isNil)(result.body)) { | ||
if ((0, lodash_1.isPlainObject)(result.body)) { | ||
@@ -27,0 +27,0 @@ res.json(result.body); |
@@ -94,2 +94,21 @@ "use strict"; | ||
}); | ||
test('It should handle 302 route types', async () => { | ||
const testRoute = (0, route_1.default)({ | ||
path: '/test7', | ||
method: 'get', | ||
async resolve(req, res, viewer) { | ||
return { | ||
statusCode: 302, | ||
body: '', | ||
headers: { | ||
location: '/test8' | ||
} | ||
}; | ||
} | ||
}); | ||
(0, registerRoute_1.default)(testRoute); | ||
const response = await (0, supertest_1.default)(app).get('/test7'); | ||
expect(response.statusCode).toBe(302); | ||
expect(response.header.location).toBe('/test8'); | ||
}); | ||
}); |
{ | ||
"name": "@orion-js/http", | ||
"version": "3.0.37", | ||
"version": "3.0.40", | ||
"main": "lib/index.js", | ||
@@ -42,3 +42,3 @@ "types": "lib/index.d.ts", | ||
}, | ||
"gitHead": "741691d7603f3d42e6e3e8fa9dc0f9de51a29424" | ||
"gitHead": "c0632276e6b8247bfe6ae2b2eee8815a3bcd441f" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21926
504