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

pulibrary / allsearch_api / 08786bb6-7373-417c-99d4-42b2c52c7457
100%
main: 100%

Build:
Build:
LAST BUILD BRANCH: remove_rails_references
DEFAULT BRANCH: main
Ran 15 Dec 2025 03:47PM UTC
Jobs 1
Files 85
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

15 Dec 2025 03:46PM UTC coverage: 100.0%. Remained the same
08786bb6-7373-417c-99d4-42b2c52c7457

Pull #496

circleci

sandbergja
Skip nokogiri-based sanitization for strings that don't contain angle brackets

It can be expensive to run the full sanitization routine on long
strings, so let's skip it if they don't need HTML-parser based sanitization,
using the heuristic of checking for an opening angle bracket.

Also, use ruby's squeeze method to avoid an expensive regular expression.

Also, avoid the potential for XSS if the source data has a malicious tag
that is encoded with HTML entities (e.g. `<script>` instead of
`<script>`.

According to the attached microbenchmark:

before:
```
Warming up --------------------------------------
           sanitizer   583.000 i/100ms
Calculating -------------------------------------
           sanitizer      6.308k (± 4.5%) i/s  (158.54 μs/i) -     31.482k in   5.001876s
```

after:
```
Warming up --------------------------------------
           sanitizer    31.808k i/100ms
Calculating -------------------------------------
           sanitizer    315.987k (± 3.1%) i/s    (3.16 μs/i) -      1.590M in   5.038977s
```
Pull Request #496: Skip nokogiri-based sanitization for strings that don't contain angle brackets

13 of 13 new or added lines in 1 file covered. (100.0%)

1435 of 1435 relevant lines covered (100.0%)

76.3 hits per line

Jobs
ID Job ID Ran Files Coverage
1 08786bb6-7373-417c-99d4-42b2c52c7457.1 15 Dec 2025 03:47PM UTC 85
100.0
Source Files on build 08786bb6-7373-417c-99d4-42b2c52c7457
  • Tree
  • List 85
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • CircleCI Build #08786BB6...
  • Pull Request #496
  • PR Base - main (#8BF072D0...)
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