io.codemodder.codemods.strip-http-header-newlines.yaml Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core-codemods Show documentation
Show all versions of core-codemods Show documentation
Codemods for fixing common errors across many Java projects
rules:
- id: strip-http-header-newlines
patterns:
- pattern: (HttpServletResponse $RESPONSE).setHeader($NAME, $VALUE)
- pattern-not: (HttpServletResponse $RESPONSE).setHeader($NAME, "...")
- pattern-not: (HttpServletResponse $RESPONSE).setHeader($NAME, Newlines.stripAll($X))
- pattern-not: (HttpServletResponse $RESPONSE).setHeader($NAME, stripAll($X))
- pattern-not-inside: |
class $CLASS {
...
final String $VALUE = ...;
...
}
message: Semgrep found a match
languages:
- java
severity: WARNING