Created
October 20, 2017 08:34
-
-
Save DragonBe/b21a8d44990001858e777e2f4415050a to your computer and use it in GitHub Desktop.
Functionality to verify if "Do not track" is set in the browser configuration.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Functionality to verify if "Do not track" is set | |
* in the browser configuration. | |
*/ | |
if (array_key_exists('HTTP_DNT', $_SERVER) && (1 === (int) $_SERVER['HTTP_DNT'])) { | |
echo 'Do not track me enabled'; | |
} else { | |
echo 'Do not track me disabled'; | |
} |
An example request header:
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Accept-Encoding:gzip, deflate, br
Accept-Language:en-GB,en;q=0.8,en-US;q=0.6,nl;q=0.4
Cache-Control:max-age=0
Connection:keep-alive
DNT:1
Host:www.in2it.be
Referer:https://www.in2it.be/
Upgrade-Insecure-Requests:1
User-Agent:Mozilla/5.0 (<script>alert('You should filter input');</script>)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Functionality to verify if "Do not track" is set in the browser configuration for Google Analytics.