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

JayBizzle / Crawler-Detect
96%

Build:
DEFAULT BRANCH: master
Repo Added 25 Apr 2016 10:45AM UTC
Files 5
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

LAST BUILD ON BRANCH master
branch: SELECT
CHANGE BRANCH
x
  • No branch selected
  • (HEAD detached at pull/493/merge)
  • (HEAD detached at pull/494/merge)
  • (HEAD detached at pull/497/merge)
  • (HEAD detached at pull/498/merge)
  • (HEAD detached at pull/500/merge)
  • (HEAD detached at pull/502/merge)
  • (HEAD detached at pull/504/merge)
  • (HEAD detached at pull/508/merge)
  • (HEAD detached at pull/510/merge)
  • (HEAD detached at pull/512/merge)
  • (HEAD detached at pull/513/merge)
  • (HEAD detached at pull/514/merge)
  • (HEAD detached at pull/519/merge)
  • (HEAD detached at pull/521/merge)
  • (HEAD detached at pull/525/merge)
  • (HEAD detached at pull/528/merge)
  • (HEAD detached at pull/529/merge)
  • (HEAD detached at pull/536/merge)
  • (HEAD detached at pull/538/merge)
  • (HEAD detached at pull/542/merge)
  • (HEAD detached at pull/543/merge)
  • (HEAD detached at pull/546/merge)
  • (HEAD detached at pull/548/merge)
  • (HEAD detached at pull/554/merge)
  • (HEAD detached at pull/555/merge)
  • (HEAD detached at pull/558/merge)
  • (HEAD detached at pull/559/merge)
  • (HEAD detached at pull/567/merge)
  • (HEAD detached at pull/568/merge)
  • (HEAD detached at pull/573/merge)
  • (HEAD detached at pull/574/merge)
  • (HEAD detached at pull/576/merge)
  • (HEAD detached at pull/577/merge)
  • (HEAD detached at pull/578/merge)
  • (HEAD detached at pull/580/merge)
  • (HEAD detached at pull/583/merge)
  • (HEAD detached at pull/585/merge)
  • (HEAD detached at pull/589/merge)
  • (HEAD detached at pull/592/merge)
  • (HEAD detached at pull/595/merge)
  • (HEAD detached at pull/596/merge)
  • (HEAD detached at pull/598/merge)
  • (HEAD detached at pull/600/merge)
  • (HEAD detached at pull/601/merge)
  • (HEAD detached at pull/602/merge)
  • (HEAD detached at pull/603/merge)
  • (HEAD detached at pull/604/merge)
  • (HEAD detached at pull/605/merge)
  • (HEAD detached at pull/607/merge)
  • 2.0
  • JayBizzle-patch-1
  • MaxGiting-patch-1
  • V1.2.27
  • add-najdu-bot
  • add-scanner-bot-signatures
  • analysis-8QJ3O6
  • analysis-X0bdWW
  • analysis-XprGYZ
  • analysis-q2xvgd
  • analysis-rdy9VG
  • analysis-zD2EZl
  • analysis-zRA009
  • bumper_update
  • chore/hygiene
  • chore/node24-actions
  • chore/phpstan
  • chore/test-suite-and-ci
  • ci/cleanup
  • dev
  • develop
  • drop_php_5_support
  • experimental_ip_checking
  • fix/compile-cache-class-key
  • issue_323
  • master
  • normalise-header-names
  • phpunit
  • pr/300
  • pr/319
  • pr/376
  • pr/398
  • remove_negative_lookbehind
  • security/phpunit-bump
  • v.1.2.32
  • v1.2.1
  • v1.2.10
  • v1.2.100
  • v1.2.101
  • v1.2.11
  • v1.2.12
  • v1.2.13
  • v1.2.14
  • v1.2.15
  • v1.2.16
  • v1.2.17
  • v1.2.18
  • v1.2.19
  • v1.2.2
  • v1.2.20
  • v1.2.21
  • v1.2.22
  • v1.2.23
  • v1.2.24
  • v1.2.25
  • v1.2.26
  • v1.2.27
  • v1.2.28
  • v1.2.29
  • v1.2.3
  • v1.2.30
  • v1.2.31
  • v1.2.32
  • v1.2.33
  • v1.2.34
  • v1.2.35
  • v1.2.36
  • v1.2.37
  • v1.2.38
  • v1.2.39
  • v1.2.4
  • v1.2.40
  • v1.2.41
  • v1.2.42
  • v1.2.43
  • v1.2.44
  • v1.2.45
  • v1.2.46
  • v1.2.47
  • v1.2.48
  • v1.2.5
  • v1.2.52
  • v1.2.53
  • v1.2.54
  • v1.2.55
  • v1.2.56
  • v1.2.57
  • v1.2.58
  • v1.2.59
  • v1.2.6
  • v1.2.60
  • v1.2.61
  • v1.2.62
  • v1.2.63
  • v1.2.64
  • v1.2.65
  • v1.2.66
  • v1.2.67
  • v1.2.68
  • v1.2.69
  • v1.2.7
  • v1.2.70
  • v1.2.71
  • v1.2.72
  • v1.2.73
  • v1.2.74
  • v1.2.75
  • v1.2.76
  • v1.2.77
  • v1.2.78
  • v1.2.79
  • v1.2.8
  • v1.2.80
  • v1.2.81
  • v1.2.82
  • v1.2.83
  • v1.2.84
  • v1.2.85
  • v1.2.86
  • v1.2.87
  • v1.2.88
  • v1.2.89
  • v1.2.9
  • v1.2.90
  • v1.2.91
  • v1.2.92
  • v1.2.93
  • v1.2.94
  • v1.2.95
  • v1.2.96
  • v1.2.97
  • v1.2.98
  • v1.2.99
  • v1.3.1

30 Jul 2026 10:20PM UTC coverage: 96.226% (+0.8%) from 95.455%
30586796524

push

github

web-flow
Normalise header names so non-SAPI sources work (#617)

* Normalise header names so non-SAPI sources work

setHttpHeaders() filtered on the HTTP_ prefix, so it only ever understood
the _SERVER-style names PHP's SAPI produces. Headers from anywhere else —
a PSR-7 request, Symfony's HeaderBag, Swoole, a Lambda event — carry their
real names ('User-Agent'), were dropped by that filter, and left the user
agent null. The idiomatic call for those sources therefore reported every
request as human, with no error to hint otherwise:

    $cd = new CrawlerDetect($request->getHeaders());
    $cd->isCrawler();  // always false

Callers who worked around it with isCrawler($request->getHeaderLine(...))
got the User-Agent checked but silently lost the rest of the chain in
Fixtures\Headers — including From and Sec-CH-UA, the two headers that catch
crawlers sending a genuine browser User-Agent.

Header names are now reduced to a canonical form (uppercased, underscore
separated, HTTP_ prefix stripped) and stored back under HTTP_, so both
naming styles land on the same key and setUserAgent() is unchanged. Values
may now be arrays too, since PSR-7 and HttpFoundation both expose them that
way.

Nothing public changes: getUaHttpHeaders() still returns prefixed names,
$this->httpHeaders keeps its HTTP_ key shape, and the _SERVER prefix filter
still excludes non-header vars such as REQUEST_URI.

* Only strip the HTTP_ prefix from genuine SAPI keys

normaliseHeaderName() folded hyphens to underscores before testing for the
prefix, so a real header named 'Http-User-Agent' became HTTP_USER_AGENT,
had the prefix stripped, and was read as the actual user agent. Same for
'Http-From' and any other Http-* custom header, giving an attacker-supplied
false positive.

Testing the prefix before folding hyphens means only an underscore
separated SAPI key can lose it. Nothing is given up: the SAPI never emits
hyphenated keys, so no real source needs the conversion to happen first.

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

51 of 53 relevant lines covered (96.23%)

22.34 hits per line

Relevant lines Covered
Build:
Build:
53 RELEVANT LINES 51 COVERED LINES
22.34 HITS PER LINE
Source Files on master
  • Tree
  • List 5
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
30586796524 master Normalise header names so non-SAPI sources work (#617) * Normalise header names so non-SAPI sources work setHttpHeaders() filtered on the HTTP_ prefix, so it only ever understood the _SERVER-style names PHP's SAPI produces. Headers from anywhere... push 30 Jul 2026 10:21PM UTC web-flow github
96.23
30497802435 normalise-header-names Merge 4970879c0 into 770e00e5b Pull #617 29 Jul 2026 10:56PM UTC web-flow github
96.23
30497123016 normalise-header-names Merge 79c3579f0 into 770e00e5b Pull #617 29 Jul 2026 10:43PM UTC web-flow github
96.08
29099061547 master Add signatures for Palo Alto Cortex Xpanse, Infrawatch, ModatScanner,… (#616) push 10 Jul 2026 02:15PM UTC web-flow github
95.45
29077650452 add-scanner-bot-signatures Merge 65957a0bf into ed842b98a Pull #616 10 Jul 2026 02:13PM UTC web-flow github
95.45
27369210037 master Bump actions to Node 24-ready versions (#614) GitHub forces actions onto Node 24 from 2026-06-16; the Test run flagged actions/checkout@v4 and actions/cache@v4 as affected. - actions/checkout v4 -> v5 (Node 24, no other changes; deliberately n... push 11 Jun 2026 06:37PM UTC web-flow github
100.0
27369046044 chore/node24-actions Merge 30e3e285d into 20d7bd4a6 Pull #614 11 Jun 2026 06:34PM UTC web-flow github
100.0
27368777057 master Drop PHP 7.1 support; tighten phpunit constraint (#608) Closes the open Dependabot alert on phpunit/phpunit (GHSA-vvj3-c3rp-c85p — unsafe deserialization in PHPT code coverage handling, fixed in 8.5.52). The previous require-dev constraint `^4.8|... push 11 Jun 2026 06:30PM UTC web-flow github
100.0
27306816198 security/phpunit-bump Merge 6e9263c16 into a2a5f5450 Pull #608 10 Jun 2026 09:15PM UTC web-flow github
100.0
27306650538 master Modernize test suite and CI: PHP 8.5, migrated phpunit config, test renames (#611) * Modernize test suite and CI: PHP 8.5, migrated config, test renames - Add PHP 8.5 to the CI matrix and move the coverage job from 8.3 to 8.4. - Migrate phpuni... push 10 Jun 2026 09:12PM UTC web-flow github
100.0
See All Builds (1690)
  • Repo on GitHub
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc