Describe the bug
Setting env WHITELIST does not work on Vercel.
The instance still serves every username.
To Reproduce
- Fork the repo, go to Vercel, and deploy with a GitHub token
- Setting env
WHITELIST in the Vercel's env panel
- Open
https://<domain>/?user=<some-other-user>
- The figure still renders. it should be rejected.
Expected behavior
Only usernames in WHITELIST are served.
Screenshots
N/A
Desktop (please complete the following information):
Unrelated to the case.
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
Smartphone (please complete the following information):
Unrelated to the case.
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
Additional context
|
$whitelist = array_map("trim", array_filter(explode(",", $_SERVER["WHITELIST"] ?? ""))); |
Whitelists are loaded via $_SERVER["WHITELIST"], which does not contain the env particularly on Vercel.
I would suggest changing to $_ENV["WHITELIST"].
Describe the bug
Setting env
WHITELISTdoes not work on Vercel.The instance still serves every username.
To Reproduce
WHITELISTin the Vercel's env panelhttps://<domain>/?user=<some-other-user>Expected behavior
Only usernames in
WHITELISTare served.Screenshots
N/A
Desktop (please complete the following information):
Unrelated to the case.
Smartphone (please complete the following information):
Unrelated to the case.
Additional context
github-readme-streak-stats/src/whitelist.php
Line 11 in a15ea36
Whitelists are loaded via
$_SERVER["WHITELIST"], which does not contain the env particularly on Vercel.I would suggest changing to
$_ENV["WHITELIST"].