mirror of https://gitee.com/bigwinds/arangodb
Fix defaultDocument in Foxx legacy
Opt-out values (i.e. empty strings) are now handled correctly again.
This commit is contained in:
parent
86997527bf
commit
71ea230d4f
|
@ -333,8 +333,8 @@ function mountController(service, mount, filename) {
|
|||
}
|
||||
|
||||
exports.routeService = function (service, throwOnErrors) {
|
||||
const defaultDocument = service.manifest.defaultDocument;
|
||||
let error = null;
|
||||
let defaultDocument = service.manifest.defaultDocument || 'index.html';
|
||||
|
||||
service.routes = {
|
||||
urlPrefix: '',
|
||||
|
@ -352,7 +352,7 @@ exports.routeService = function (service, throwOnErrors) {
|
|||
}
|
||||
};
|
||||
|
||||
if ((service.mount + defaultDocument) !== service.mount) {
|
||||
if (defaultDocument) {
|
||||
// only add redirection if src and target are not the same
|
||||
service.routes.routes.push({
|
||||
url: {match: '/'},
|
||||
|
|
|
@ -352,6 +352,10 @@ function checkManifest(filename, manifest) {
|
|||
});
|
||||
}
|
||||
|
||||
if (legacy && manifest.defaultDocument === undefined) {
|
||||
manifest.defaultDocument = 'index.html';
|
||||
}
|
||||
|
||||
if (typeof manifest.controllers === 'string') {
|
||||
manifest.controllers = {'/': manifest.controllers};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue