adapt-authoring-server 1.4.0 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/Router.js
CHANGED
|
@@ -79,6 +79,9 @@ class Router {
|
|
|
79
79
|
if (_.isString(this.parentRouter.path)) {
|
|
80
80
|
p += this.parentRouter.path
|
|
81
81
|
}
|
|
82
|
+
if (p[p.length - 1] === '/' && this.root[0] === '/') {
|
|
83
|
+
return p + this.root.slice(1)
|
|
84
|
+
}
|
|
82
85
|
if (p[p.length - 1] !== '/' && this.root[0] !== '/') {
|
|
83
86
|
p += '/'
|
|
84
87
|
}
|
package/lib/ServerUtils.js
CHANGED
package/package.json
CHANGED
package/tests/Router.spec.js
CHANGED
|
@@ -98,7 +98,7 @@ describe('Router', () => {
|
|
|
98
98
|
const childRouter = new Router('/users', parentRouter)
|
|
99
99
|
|
|
100
100
|
// Documents existing behavior: double slashes are allowed
|
|
101
|
-
assert.equal(childRouter.path, '/api
|
|
101
|
+
assert.equal(childRouter.path, '/api/users')
|
|
102
102
|
})
|
|
103
103
|
|
|
104
104
|
it('should handle root path without parent path property', () => {
|
|
@@ -76,9 +76,9 @@ describe('ServerUtils', () => {
|
|
|
76
76
|
|
|
77
77
|
ServerUtils.addExistenceProps(req, res, next)
|
|
78
78
|
|
|
79
|
-
assert.equal(req.hasBody,
|
|
80
|
-
assert.equal(req.hasParams,
|
|
81
|
-
assert.equal(req.hasQuery,
|
|
79
|
+
assert.equal(req.hasBody, false)
|
|
80
|
+
assert.equal(req.hasParams, false)
|
|
81
|
+
assert.equal(req.hasQuery, false)
|
|
82
82
|
})
|
|
83
83
|
|
|
84
84
|
it('should mark has* false when all entries are null or undefined', () => {
|
|
File without changes
|