handle method

  1. @override
IDoxRequest handle(
  1. IDoxRequest req
)
override

the names are lower case: the server makes them lower case anyway, and a name that is already lower case needs no new string.

Implementation

@override
IDoxRequest handle(IDoxRequest req) {
  HttpHeaders headers = req.httpRequest.response.headers;
  _set(headers, 'x-content-type-options', contentTypeOptions);
  _set(headers, 'x-frame-options', frameOptions);
  _set(headers, 'referrer-policy', referrerPolicy);
  _set(headers, 'permissions-policy', permissionsPolicy);
  _set(headers, 'cross-origin-opener-policy', crossOriginOpenerPolicy);
  _set(headers, 'content-security-policy', contentSecurityPolicy);
  _set(headers, 'x-xss-protection', xssProtection);
  if (req is DoxRequest && req.isSecure()) {
    _set(headers, 'strict-transport-security', strictTransportSecurity);
  }
  for (MapEntry<String, String?> header in extra.entries) {
    _set(headers, header.key, header.value);
  }
  return req;
}