Skip to content

Instantly share code, notes, and snippets.

@rbricheno
Last active July 25, 2019 16:55
Show Gist options
  • Save rbricheno/961705db8df589896c2a0b16e4296a0d to your computer and use it in GitHub Desktop.
Save rbricheno/961705db8df589896c2a0b16e4296a0d to your computer and use it in GitHub Desktop.

This specification briefly describes an optional header used to negotiate evil things web sites can and can't do.

On the assumption that some people would rather simply bounce off a site that tries to do these things, and not waste time.

An additional header is specified for the client and the server.

The header looks like this:

Accept-Evil: aaaaaaa

or:

Require-Evil: aaaaaaa

where each character has a value and a position.

Client header

Accept-Evil:

  • n - Never: Client will never accept this
  • c - Conditionally: Client will conditionally accept this on a per site basis
  • a - Always: Client will always accept this

Server header

Require-Evil:

  • r - Required: If you do not allow this, the server will not function as intended
  • a - Available: The server will offer this content if you accept it
  • n - Not required: The server will not atttempt to send you this content

Positional fields:

  1. Advertisements
  2. Notifications
  3. Request to handle data in a way that would violate GDPR without explicit authorisation
  4. Provide data or integration to third-party, other than by means of a hyperlink
  5. Popup (including modal popup)
  6. Audio
  7. Video

Examples

For example, a normal web browser configuration would send this:

Accept-Evil: aaaaaaa

My web browser might send this:

Accept-Evil: nnccncc

That means I will never accept adverts, notifications, or popups. I may conditionally accept GDPR violations, third party integrations, audio and video.

A video hosting web site might have a Require-Evil header like this:

Require-Evil: annanar

The web site must have permission to display video. If the client allows audio on this site, that is available too. It will optionally serve advertisements if the client allows this. It will never use notifications or violate the GDPR. It will offer third party integrations if the client allows this. It will never display popups.

An evil video hosting web site might look like this:

Require-Evil: rnnanar

A correctly configured client will quickly know not to continue talking to this web site as it requires advertisements to function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment