I need to add a HSTS header to this file , but I am unsure of how to do it.
import { injectable, inject } from 'tsyringe';
import { NextFunction, Request, Response } from 'express';
import * as Types from '../../types';
@injectable()
class EncryptionController {
constructor(@inject('EncryptionService') private service: Types.EncryptionService) { }
public encrypt = async (req: Request, res: Response<Types.EncryptResponsePayload | Types.ServiceError>, next: NextFunction) => {
try {
const { publicKeys, payload } = req.body as Types.EncryptRequest;
const response = await this.service.encrypt(payload, publicKeys);
res.status(200).json(response);
} catch (error) {
if (error.message === 'not found' || error.message === 'Secret not found') {
res.status(404).json({ message: error.message });
} else {
res.status(400).json({ message: error.message });
}
}
}
I would appreciate any direction on this