Enable no-case-declarations in codebase (#139243)

Fixes #139236

This can catch tricky programming mistakes that cause a runtime error. See 7e266b2c42 as an example of the type of bug this can prevent
This commit is contained in:
Matt Bierner
2021-12-15 17:15:35 -08:00
committed by GitHub
parent f589173345
commit e7b3724e0c
68 changed files with 233 additions and 158 deletions

View File

@@ -120,7 +120,7 @@ export function createServer(nonce: string) {
const server = http.createServer(function (req, res) {
const reqUrl = url.parse(req.url!, /* parseQueryString */ true);
switch (reqUrl.pathname) {
case '/signin':
case '/signin': {
const receivedNonce = ((reqUrl.query.nonce as string) || '').replace(/ /g, '+');
if (receivedNonce === nonce) {
deferredRedirect.resolve({ req, res });
@@ -129,6 +129,7 @@ export function createServer(nonce: string) {
deferredRedirect.resolve({ err, res });
}
break;
}
case '/':
sendFile(res, path.join(__dirname, '../media/auth.html'), 'text/html; charset=utf-8');
break;