admin.appserverSetHstsHeaderMaxAge( config as element(configuration), appserver-id as (Number|String), value as Number ) as element(configuration)
This function sets the value of max-age directive in HSTS header for the specified App Server
http://marklogic.com/xdmp/privileges/admin/app-server-security
http://marklogic.com/xdmp/privileges/admin/app-server-security/{id}
http://marklogic.com/xdmp/privileges/admin/group-security
http://marklogic.com/xdmp/privileges/admin/group-security/{id}
const admin = require('/MarkLogic/admin.xqy'); var config = admin.getConfiguration() var groupid = admin.groupGetId(config, "Default") admin.appserverSetHstsHeaderMaxAge(config, admin.appserverGetId(config, groupid, "myAppServer"),31536000)