Rubocop: Rails cops: referer vs referrer

Created on 4 May 2016  路  10Comments  路  Source: rubocop-hq/rubocop

Rails supports both request.referer and request.referrer, and after perusing our codebase we discovered that we're using both. It would be great to have a cop to enforce one or the other for the sake of consistency.

feature request good first issue

Most helpful comment

Old issue I know however, this one killed my flow 馃槀 a cop against something like this is imho, useless! and it wants the incorrect spelling of the word.

The correct spelling is referrer !

All 10 comments

Isn't referrer the only correct spelling of the word? :-) Yeah, guess we can have a cop for this. PR welcome!

Haha, well technically speaking... https://en.wikipedia.org/wiki/HTTP_referer#Etymology

Good to know! :-)

@mockdeep, based on the wiki article, this is quite interesting. It appears that the misspelling has become the standard. It raises an interesting question of if referer or referrer should be used. I wonder which spelling other common libraries and frameworks prefer.

@rrosenblum something tells me it isn't very consistently spelled anywhere, though I think we'd go with referer in our codebase just for consistency with the spec.

I could see it being a configurable cop, though, so people can pick their flavor.

I think we'd go with referer in our codebase
I could see it being a configurable cop

I was thinking the same things.

Nice, thanks!

Oh, the confusion: https://www.w3.org/TR/html5/links.html#link-type-noreferrer 馃槅

[鈥 the user agent must not include a Referer (sic) HTTP header [鈥

Old issue I know however, this one killed my flow 馃槀 a cop against something like this is imho, useless! and it wants the incorrect spelling of the word.

The correct spelling is referrer !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

benoittgt picture benoittgt  路  3Comments

printercu picture printercu  路  3Comments

millisami picture millisami  路  3Comments

cabello picture cabello  路  3Comments

david942j picture david942j  路  3Comments