class Helmet::DNSPrefetchControllerHandler


Some browsers optimistically prefetch DNS records for performance, which can have security implications. Read more about it on MDN and on Chromium's docs.

This handler sets the X-DNS-Prefetch-Control to control browsers' DNS prefetching behavior.

Disable DNS prefetching

You can disable DNS prefetching:

server ="", 8080, [ false),
  # ...

You can also leave out the allow argument if you're doing this—false is the default:

server ="", 8080, [,
  # ...

Enable DNS prefetching

server ="", 8080, [ true),
  # ...

Defined in:


Class Method Summary

Instance Method Summary

Class Method Detail

def : Bool = false) #

[View source]

Instance Method Detail

def call(context : HTTP::Server::Context) #

[View source]