Implement HSTS preload
This allows browsers to query https directly instead of the initial http redirect https://hstspreload.org/#opt-in says it should be explicitly opt in
This commit is contained in:
@@ -322,6 +322,8 @@ async function setReverseProxyConfig(req, res, next) {
|
||||
|
||||
if (req.body.csp !== null && typeof req.body.csp !== 'string') return next(new HttpError(400, 'csp is not a string'));
|
||||
|
||||
if (typeof req.body.hstsPreload !== 'boolean') return next(new HttpError(400, 'hstsPreload must be a boolean'));
|
||||
|
||||
const [error] = await safe(apps.setReverseProxyConfig(req.app, req.body, AuditSource.fromRequest(req)));
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user