mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-02-17 00:40:56 -05:00
Added undefined checking to accepted language
This commit is contained in:
parent
a9a3689e15
commit
fcf52cfbf7
1 changed files with 1 additions and 1 deletions
|
@ -85,7 +85,7 @@ setupChinaRedirectMiddleware = (app) ->
|
|||
geo = geoip.lookup(ip)
|
||||
if geo?.country isnt "CN" then return false
|
||||
firstAcceptedLanguage = req.acceptedLanguages[0]
|
||||
isChinese = firstAcceptedLanguage.indexOf? "zh"
|
||||
isChinese = firstAcceptedLanguage?.indexOf? "zh"
|
||||
return isChinese? and isChinese isnt -1
|
||||
else
|
||||
return false #If the user is already redirected, don't redirect them!
|
||||
|
|
Loading…
Reference in a new issue