import { DnsPrefetchOptions } from '@ioc:Adonis/Addons/Shield' ; import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext' ; import { noop } from './noop' ; /**
 * Factory that returns a function to set `X-DNS-Prefetch-Control` header.
 */ export function dnsPrefetchFactory ( options ) { if ( ! options . enabled ) { return noop ; } const value = options . allow ? 'on' : 'off' ; return function dnsPrefetch ( { response } ) { response . header ( 'X-DNS-Prefetch-Control' , value ) ; } ; }