src/cordova/serve.js
function absolutePathHandler (request, response, next) {
    if (!request.headers.referer) return next();

    // @todo Use 'url.URL' constructor instead since 'url.parse' was deprecated since v11.0.0
    const { pathname } = url.parse(request.headers.referer); // eslint-disable-line
    const platform = pathname.split('/')[1];

    if (installedPlatforms.includes(platform) &&
        !request.originalUrl.includes(platform)) {
        response.redirect(`/${platform}/www` + request.originalUrl);
    } else {
        next();
    }
}
function absolutePathHandler (request, response, next) {
    if (!request.headers.referer) return next();

    // @todo Use 'url.URL' constructor instead since 'url.parse' was deprecated since v11.0.0
    const { pathname } = url.parse(request.headers.referer); // eslint-disable-line
    const platform = pathname.split('/')[1];

    if (installedPlatforms.includes(platform) &&
        !request.originalUrl.includes(platform)) {
        response.redirect(`/${platform}/www` + request.originalUrl);
    } else {
        next();
    }
}
function absolutePathHandler ( request , response , next ) { if ( ! request . headers . referer ) return next ( ) ; // @todo Use 'url.URL' constructor instead since 'url.parse' was deprecated since v11.0.0 const { pathname } = url . parse ( request . headers . referer ) ; // eslint-disable-line const platform = pathname . split ( '/' ) [ 1 ] ; if ( installedPlatforms . includes ( platform ) && ! request . originalUrl . includes ( platform ) ) { response . redirect ( ` ${ platform } ` + request . originalUrl ) ; } else { next ( ) ; } }
https://issues.apache.org/jira/browse/CB-11274 Use referer url to redirect absolute urls to the requested platform resources so that an URL is resolved against that platform www directory.
https : // issues . apache . org / jira / browse / CB - 11274 Use referer url to redirect absolute urls to the requested platform resources so that an URL is resolved against that platform www directory .