MCPcopy
hub / github.com/github/docs / getLanguage

Function getLanguage

middleware/redirects/handle-redirects.js:163–168  ·  view source on GitHub ↗
(req, default_ = 'en')

Source from the content-addressed store, hash-verified

161}
162
163function getLanguage(req, default_ = 'en') {
164 // req.context.userLanguage, if it truthy, is always a valid supported
165 // language. It's whatever was in the user's request but filtered
166 // based on non-WIP languages in lib/languages.js
167 return req.context.userLanguage || default_
168}
169
170function usePermanentRedirect(req) {
171 // If the redirect was to essentially swap `enterprise-server@latest`

Callers 1

handleRedirectsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected