express icon indicating copy to clipboard operation
express copied to clipboard

Add deprecation warning to "Referrer" special-casing

Open rileyjshaw opened this issue 4 years ago • 3 comments

re: https://github.com/expressjs/express/issues/3951

Test plan: npm test

rileyjshaw avatar Nov 21 '19 23:11 rileyjshaw

👌👌

AhmadIbrahiim avatar Dec 03 '19 22:12 AhmadIbrahiim

@dougwilson thanks for the clarification, and sorry for the delay! I just updated the PR.

Now, if someone calls:

  • req.get('referer') and receives this.headers.referrer, or
  • req.get('referrer') and receives this.headers.referer

…the deprecation notice will print.

I hope that's what you meant re: lifecycles. As far as I can tell, the only other place this special-casing extends to is lib/response.js:750-753, but since that uses req.get() it should still flag correctly.

rileyjshaw avatar Jan 16 '20 02:01 rileyjshaw

Also worth noting: tests all pass on this commit, but will need to be updated once the special-casing is removed.

rileyjshaw avatar Jan 16 '20 02:01 rileyjshaw