class
Analyzer::Go::Httprouter
- Analyzer::Go::Httprouter
- Analyzer
- Reference
- Object
Defined in:
analyzer/analyzers/go/httprouter.crConstant Summary
-
IMPORT_MARKER =
"github.com/julienschmidt/httprouter" -
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_PATTERNS =
[{"ByName(", /ByName\s*\(\s*[\"']([^\"']+)[\"']\s*\)/, "path"}, {"Query().Get(", /Query\(\)\s*\.\s*Get\s*\(\s*[\"']([^\"']+)[\"']\s*\)/, "query"}, {"PostFormValue(", /PostFormValue\s*\(\s*[\"']([^\"']+)[\"']\s*\)/, "form"}, {"Header.Get(", /Header\s*\.\s*Get\s*\(\s*[\"']([^\"']+)[\"']\s*\)/, "header"}, {"Cookie(", /Cookie\s*\(\s*[\"']([^\"']+)[\"']\s*\)/, "cookie"}]