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

mozilla / blurts-server / #12935

pending completion
#12935

push

circleci

toufali
fix undefined nonce for SEO breach pages

282 of 1595 branches covered (17.68%)

Branch coverage included in aggregate %.

959 of 4309 relevant lines covered (22.26%)

1.85 hits per line

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

0.0
/src/controllers/breach-details.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

7
import { guestLayout } from '../views/guestLayout.js'
8
import { allBreaches } from '../views/partials/all-breaches.js'
9
import { breachDetails } from '../views/partials/breach-detail.js'
10

11
async function breachesPage (req, res) {
12
  const data = {
×
13
    partial: allBreaches,
14
    breaches: req.app.locals.breaches,
15
    breachLogos: req.app.locals.breachLogoMap,
16
    nonce: res.locals.nonce
17
  }
18

19
  res.send(guestLayout(data))
×
20
}
21

22
async function breachDetailsPage (req, res) {
23
  const allBreaches = req.app.locals.breaches
×
24
  const breachName = req.params.breachName
×
25
  const featuredBreach = getBreachByName(allBreaches, breachName)
×
26

27
  if (!featuredBreach) {
×
28
    return res.redirect('/')
×
29
  }
30

31
  const data = {
×
32
    partial: breachDetails,
33
    breach: featuredBreach,
34
    nonce: res.locals.nonce
35
  }
36

37
  res.send(guestLayout(data))
×
38
}
39

40
export {
41
  breachDetailsPage,
42
  breachesPage
43
}
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