HUGO

Semi-OT: Header to Block FLoc

Earlier today GitHub added a header across all GitHub Pages (not the ones using custom domains) to block Google’s new advertising technology (Floc) meant to replace third party cookies.

The header is the following:

Permissions-Policy: interest-cohort=()

If you are using Netlify you can set this header for your project following these instructions.


There are privacy concerns about the new technology and browsers like Firefox, Brave and Vivaldi will not be adopting it.

Still this technology will ship with Chrome soon, therefore if you are concerned about the privacy of your website’s visitors, you may want to add this header to your Hugo projects now.

3 Likes

And when you are doing this, be careful to not override any pre-existing permission-policy settings. You can separate them via ,

Permissions-Policy: geolocation=(self), camera=(), fullscreen=*, interest-cohort=()
3 Likes

On Netflify multi-value headers must be seperated by line, but they will be concatenated on build.

Here’s mine:

[[headers]]
  for = "/*"
  [headers.values]
    Content-Security-Policy = '''
    default-src 'self',
    frame-ancestors 'none'
    '''
    Permissions-Policy = '''
    accelerometer=(),
    camera=(),
    geolocation=(),
    gyroscope=(),
    interest-cohort=(),
    magnetometer=(),
    microphone=(),
    payment=(),
    usb=()
    '''
2 Likes