• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mozilla / blurts-server / #13412

pending completion
#13412

push

circleci

Vinnl
Add unique page titles

282 of 1792 branches covered (15.74%)

Branch coverage included in aggregate %.

959 of 4671 relevant lines covered (20.53%)

1.71 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/controllers/breachDetail.js
1
/* This Source Code Form is subject to the terms of the Mozilla Public
2
 * License, v. 2.0. If a copy of the MPL was not distributed with this
3
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4

5
import { getBreachByName } from '../utils/hibp.js'
6
import { getMessage } from '../utils/fluent.js'
7

8
import { guestLayout } from '../views/guestLayout.js'
9
import { allBreaches } from '../views/partials/allBreaches.js'
10
import { breachDetail } from '../views/partials/breachDetail.js'
11

12
async function breachesPage (req, res) {
13
  const data = {
×
14
    partial: allBreaches,
15
    breaches: req.app.locals.breaches,
16
    breachLogos: req.app.locals.breachLogoMap,
17
    meta: {
18
      title: getMessage('breach-all-meta-title'),
19
      socialTitle: getMessage('breach-all-meta-social-title'),
20
      socialDescription: getMessage('breach-all-meta-social-description')
21
    }
22
  }
23

24
  res.send(guestLayout(data))
×
25
}
26

27
async function breachDetailPage (req, res) {
28
  const allBreaches = req.app.locals.breaches
×
29
  const breachName = req.params.breachName
×
30
  const featuredBreach = getBreachByName(allBreaches, breachName)
×
31

32
  if (!featuredBreach) {
×
33
    return res.redirect('/')
×
34
  }
35

36
  const data = {
×
37
    partial: breachDetail,
38
    skipPartialModule: true,
39
    breach: featuredBreach,
40
    breachLogos: req.app.locals.breachLogoMap,
41
    meta: {
42
      title: getMessage('breach-detail-meta-title', { company: featuredBreach.Name }),
43
      socialTitle: getMessage('breach-detail-meta-social-title', { company: featuredBreach.Name }),
44
      socialDescription: getMessage('breach-detail-meta-social-description')
45
    }
46
  }
47

48
  res.send(guestLayout(data))
×
49
}
50

51
export {
52
  breachDetailPage,
53
  breachesPage
54
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc