class
Analyzer::Go::Fasthttp
- Analyzer::Go::Fasthttp
- Analyzer
- Reference
- Object
Defined in:
analyzer/analyzers/go/fasthttp.crConstant Summary
-
IMPORT_MARKER =
"github.com/valyala/fasthttp" -
IMPORT_MARKER_RE =
Regex.union(IMPORT_MARKER) -
One precompiled matcher instead of a
String#includes?scan per.gofile:includes?runs Rabin-Karp over the whole buffer and the marker is absent in the overwhelming majority of files in a polyglot repo, so every one of them pays the full scan. SeeAnalyzer#content_matches?. -
PARAM_LINE_SIGNAL_RE =
Regex.union("QueryArgs", "PostArgs", "Request.Header", "FormValue", "UserValue", "PostBody", ".Request.Body(") -
Cheap pre-filter for
analyze_param_line, called on EVERY line of every fasthttp file (not just route lines). Union of every literal substring any of the six scans below requires to possibly match — a single precompiledRegex.union(PCRE2 JIT) pass replaces six unconditionalString#scanregex attempts on lines that can't possibly contain a param accessor.