3 ms·
I once saw this implemented as a regex. Unfortunately the regex was refer*er. “Tests pass, ship it”
by inopinatus 5y ago
I once saw this implemented as a regex. Unfortunately the regex was refer*er.
“Tests pass, ship it”
- exikyut 5y agoThe tests clearly did not include spinning up an HTTP server and actually using the correctly-spelled header (as per correct English), then.
- dqv 5y agoI don't know enough about overflows, but that could theoretically be exploited, right? referrrrrrrrrrrrrrrrrrrrrrrrrrrer
- zeusk 5y agoinb4 refeer (should've used referr?er)
- xmprt 5y agoI also feel like this is a buffer overflow waiting to happen. If somehow someone makes the header length way longer than expected (eg. referrrrrrrrrrrrrrer).
- jsjohnst 5y ago? is 0 or 1 instances of the preceding character, so referrrrrrrrrrrrrrer wouldn’t match /referr?er/, only referer or referrer. Proof: https://regex101.com/r/s56ebD/1 https://regex101.com/r/s56ebD/1
- xmprt 5y agoI'm replying to the grandparent comment. I said "Also" meaning I was adding onto your comment.